[Groonga-commit] groonga/groonga at 6fdb659 [master] windows dat: support last modified time update on flush

Back to archive index

Kouhei Sutou null+****@clear*****
Tue May 10 16:31:02 JST 2016


Kouhei Sutou	2016-05-10 16:31:02 +0900 (Tue, 10 May 2016)

  New Revision: 6fdb6598f9ad2c0a4fd3422894ddd36c013008d3
  https://github.com/groonga/groonga/commit/6fdb6598f9ad2c0a4fd3422894ddd36c013008d3

  Message:
    windows dat: support last modified time update on flush

  Modified files:
    lib/dat/file-impl.cpp

  Modified: lib/dat/file-impl.cpp (+9 -0)
===================================================================
--- lib/dat/file-impl.cpp    2016-05-10 15:40:40 +0900 (128556d)
+++ lib/dat/file-impl.cpp    2016-05-10 16:31:02 +0900 (ebc418a)
@@ -130,6 +130,15 @@ void FileImpl::flush() {
 
   BOOL succeeded = ::FlushViewOfFile(addr_, size_);
   GRN_DAT_THROW_IF(IO_ERROR, !succeeded);
+
+  SYSTEMTIME system_time;
+  GetSystemTime(&system_time);
+  FILETIME file_time;
+  succeeded = SystemTimeToFileTime(&system_time, &file_time);
+  GRN_DAT_THROW_IF(IO_ERROR, !succeeded);
+
+  succeeded = SetFileTime(file_, NULL, NULL, &file_time);
+  GRN_DAT_THROW_IF(IO_ERROR, !succeeded);
 }
 
 void FileImpl::create_(const char *path, UInt64 size) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index