mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-18 16:37:13 +01:00
fixed #438: use FILE_WRITE_ATTRIBUTES instead of
FILE_ALL_ACCESS permission to set file time
This commit is contained in:
parent
bd9d051e46
commit
7cd76b4f69
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user