diff --git a/Foundation/src/File_WIN32.cpp b/Foundation/src/File_WIN32.cpp index f58282632..202152d7f 100644 --- a/Foundation/src/File_WIN32.cpp +++ b/Foundation/src/File_WIN32.cpp @@ -228,7 +228,7 @@ void FileImpl::setLastModifiedImpl(const Timestamp& ts) FILETIME ft; ft.dwLowDateTime = low; ft.dwHighDateTime = high; - FileHandle fh(_path, FILE_ALL_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); + FileHandle fh(_path, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); if (SetFileTime(fh.get(), 0, &ft, &ft) == 0) handleLastErrorImpl(_path); } diff --git a/Foundation/src/File_WIN32U.cpp b/Foundation/src/File_WIN32U.cpp index 0522ab631..0c2a053e8 100644 --- a/Foundation/src/File_WIN32U.cpp +++ b/Foundation/src/File_WIN32U.cpp @@ -232,7 +232,7 @@ void FileImpl::setLastModifiedImpl(const Timestamp& ts) FILETIME ft; ft.dwLowDateTime = low; ft.dwHighDateTime = high; - FileHandle fh(_path, _upath, FILE_ALL_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); + FileHandle fh(_path, _upath, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); if (SetFileTime(fh.get(), 0, &ft, &ft) == 0) handleLastErrorImpl(_path); }