summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2015-09-28 20:49:05 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2015-09-28 23:18:14 (GMT)
commitecd71c9c1a0735cb84234344387f4138a1853fa5 (patch)
tree07803d15f71ad0961c08298654445e916eec6649 /Source/cmSystemTools.cxx
parent19c6f4eefce4f58538dd750af5d014bba23192f3 (diff)
downloadCMake-ecd71c9c1a0735cb84234344387f4138a1853fa5.zip
CMake-ecd71c9c1a0735cb84234344387f4138a1853fa5.tar.gz
CMake-ecd71c9c1a0735cb84234344387f4138a1853fa5.tar.bz2
SystemTools: time operations on directories
On windows FILE_FLAG_BACKUP_SEMANTICS enables us to read/write time both on files and directories.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index fa84478..d3c1f16 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2045,10 +2045,11 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile)
cmSystemToolsWindowsHandle hFrom =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fromFile).c_str(),
GENERIC_READ, FILE_SHARE_READ, 0,
- OPEN_EXISTING, 0, 0);
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
cmSystemToolsWindowsHandle hTo =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(toFile).c_str(),
- FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, 0, 0);
+ FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!hFrom || !hTo)
{
return false;
@@ -2100,7 +2101,8 @@ bool cmSystemTools::FileTimeGet(const char* fname, cmSystemToolsFileTime* t)
#if defined(_WIN32) && !defined(__CYGWIN__)
cmSystemToolsWindowsHandle h =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(),
- GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+ GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!h)
{
return false;
@@ -2127,7 +2129,8 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t)
#if defined(_WIN32) && !defined(__CYGWIN__)
cmSystemToolsWindowsHandle h =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(),
- FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, 0, 0);
+ FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!h)
{
return false;