summaryrefslogtreecommitdiff
path: root/lib/Support/Windows/PathV2.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Windows/PathV2.inc')
-rw-r--r--lib/Support/Windows/PathV2.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc
index 006e31a5bd..5e0375fcf9 100644
--- a/lib/Support/Windows/PathV2.inc
+++ b/lib/Support/Windows/PathV2.inc
@@ -585,6 +585,17 @@ error_code permissions(const Twine &path, perms prms) {
return error_code::success();
}
+error_code setLastModificationAndAccessTime(int FD, TimeValue Time) {
+ ULARGE_INTEGER UI;
+ UI.QuadPart = Time.toWin32Time();
+ FILETIME FT;
+ FT.dwLowDateTime = UI.LowPart;
+ FT.dwHighDateTime = UI.HighPart;
+ HANDLE FileHandle = reinterpret_cast<HANDLE>(_get_osfhandle(FD));
+ if (!SetFileTime(FileHandle, NULL, &FT, &FT))
+ return windows_error(::GetLastError());
+ return error_code::success();
+}
// FIXME: mode should be used here and default to user r/w only,
// it currently comes in as a UNIX mode.