]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/stat.cpp
Add a flag to make statting directories work on win32
[libs/core.git] / source / fs / stat.cpp
index 245dd4ea9e05e4510768343ad8a5ff62a066313f..2419c2990c9bd9353f06e1ddcaf481afae6bb03e 100644 (file)
@@ -2,6 +2,7 @@
 #include <windows.h>
 #include <aclapi.h>
 #else
+#define _FILE_OFFSET_BITS 64
 #include <sys/stat.h>
 #include <grp.h>
 #include <pwd.h>
@@ -87,7 +88,7 @@ Stat Stat::stat(const Path &path)
 {
 #ifdef WIN32
        HANDLE handle;
-       handle = CreateFile(path.str().c_str(), 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+       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");