Index: base/file_util_win.cc |
diff --git a/base/file_util_win.cc b/base/file_util_win.cc |
index b3ce89623937881b9c043fe4bdba398b87878d91..f538c20c4f847ae243873e65a333dc367bf9065a 100644 |
--- a/base/file_util_win.cc |
+++ b/base/file_util_win.cc |
@@ -696,6 +696,15 @@ bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) { |
return true; |
} |
+bool SetLastModifiedTime(const FilePath& file_path, base::Time last_modified) { |
+ FILETIME timestamp(last_modified.ToFileTime()); |
+ ScopedHandle file_handle( |
+ CreateFile(file_path.value().c_str(), FILE_WRITE_ATTRIBUTES, |
+ kFileShareAll, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)); |
+ BOOL ret = SetFileTime(file_handle.Get(), NULL, ×tamp, ×tamp); |
+ return ret != 0; |
+} |
+ |
FILE* OpenFile(const FilePath& filename, const char* mode) { |
std::wstring w_mode = ASCIIToWide(std::string(mode)); |
return _wfsopen(filename.value().c_str(), w_mode.c_str(), _SH_DENYNO); |