HANDLE handle;
handle = CreateFile(path.str().c_str(), 0, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
if(handle==INVALID_HANDLE_VALUE)
- throw system_error("CreateFile");
+ {
+ DWORD err = GetLastError();
+ if(err==ERROR_FILE_NOT_FOUND)
+ return Stat();
+ else
+ throw system_error("CreateFile", err);
+ }
BY_HANDLE_FILE_INFORMATION info;
if(!GetFileInformationByHandle(handle, &info))