]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/windows/stat.cpp
Check for ERROR_PATH_NOT_FOUND in adition to ERROR_FILE_NOT_FOUND
[libs/core.git] / source / fs / windows / stat.cpp
index 229d9e9485cda8a6c8e1f31d30b4f83fae232836..ac9e0c977ac537fcd97bb9230b794ba7f334cc8a 100644 (file)
@@ -77,10 +77,10 @@ Stat Stat::stat(const Path &path)
        if(handle==INVALID_HANDLE_VALUE)
        {
                DWORD err = GetLastError();
-               if(err==ERROR_FILE_NOT_FOUND)
+               if(err==ERROR_FILE_NOT_FOUND || err==ERROR_PATH_NOT_FOUND)
                        return Stat();
                else
-                       throw system_error("CreateFile", err);
+                       throw system_error(format("CreateFile(%s)", path), err);
        }
 
        BY_HANDLE_FILE_INFORMATION info;