Win32 Check for file?
Is there any way to check if a file exists WITHOUT creating it in Win32 or c++? I've tried C++, I don't get anything except empty files that were created when I tried to check their existence.
Thanks
In C++ a std::ifstream shouldn't create a new file if it doesn't exist. Otherwise in Win32, you should be able to use CreateFile() with the OPEN_EXISTING flag.
I'm sure fopen() also has a flag that turns off the auto creation as well ... google will show you the way!
Edit: Infact if you open a file for reading it should never be created if it doesn't exist - it should just fail!
Edit: Infact if you open a file for reading it should never be created if it doesn't exist - it should just fail!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement