I found a problem in different c++ function/way to try if a file exist.
Scenario :
A timer test if a file exist over a UNC path every x seconds.
It works fine.
I lost the network.
Program hangs during a while...
Network is reconnected and now every time i try if the file exist the program hangs.
The code :
The hang after the reconnection happen with :
WIN32_FIND_DATA FindFileData;
if(INVALID_HANDLE_VALUE == FindFirstFile(onlineFile, &FindFileData))
And with :
DWORD dwAttrib = GetFileAttributes(FileName.c_bstr());
return (dwAttrib != INVALID_FILE_ATTRIBUTES &&
!(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
For me it is a very basicall function but it hang on 5 computers. (Win 7).
Is there a special function to test access to file over network ?
Thanks.