From b55143ecaa986aa3ba93dc6a078ed7d9cf495b1c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 26 Nov 2018 10:22:42 +0200 Subject: Add note on "filesystem time" on Windows --- libbutl/filesystem.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libbutl/filesystem.cxx') diff --git a/libbutl/filesystem.cxx b/libbutl/filesystem.cxx index 0729964..e87669d 100644 --- a/libbutl/filesystem.cxx +++ b/libbutl/filesystem.cxx @@ -196,8 +196,15 @@ namespace butl { if (file_exists (p)) { + // Note that on Windows there are two times: the precise time (which is + // what we get with system_clock::now()) and what we will call the + // "filesystem time", which can lag the precise time by as much as a + // couple of milliseconds. To get the filesystem time use + // GetSystemTimeAsFileTime(). This is just a heads-up in case we decide + // to change this code at some point. + // #ifndef _WIN32 - if (utime (p.string ().c_str (), nullptr) == -1) + if (utime (p.string ().c_str (), nullptr) == -1) #else if (_utime (p.string ().c_str (), nullptr) == -1) #endif -- cgit v1.1