Mariusz PluciĆski vshader@gmail.com writes:
+static BOOL GAMEUX_isFileExists(LPCWSTR sFile) +{
- HANDLE hFile;
- hFile = CreateFileW(sFile, GENERIC_READ, 0,
NULL, OPEN_EXISTING, 0, NULL);
- if(hFile == INVALID_HANDLE_VALUE)
return FALSE;
- CloseHandle(hFile);
- return TRUE;
+}
This sort of thing is not a good idea in general, even if it had a more grammatically correct function name ;-) If you need to load a file you have to open it anyway, so you can check for errors at that point. Checking for existence beforehand is only doing duplicate work.