VFS: VFile.sync now updates modified time
Jeffrey Pfau jeffrey@endrift.com
Wed, 15 Jun 2016 22:46:24 -0700
2 files changed,
10 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -49,6 +49,7 @@ - OpenGL: Add texSize uniform
- Qt: Add refresh button to controller editing - ARM7: Clean up instruction decoding for future expandability - Debugger: CLI debugger now exits when end-of-stream is reached + - VFS: VFile.sync now updates modified time 0.4.0: (2016-02-02) Features:
M
src/util/vfs/vfs-fd.c
→
src/util/vfs/vfs-fd.c
@@ -9,6 +9,7 @@ #include <fcntl.h>
#include <sys/stat.h> #ifndef _WIN32 #include <sys/mman.h> +#include <sys/time.h> #else #include <windows.h> #endif@@ -159,8 +160,15 @@ UNUSED(buffer);
UNUSED(size); struct VFileFD* vfd = (struct VFileFD*) vf; #ifndef _WIN32 + futimes(vfd->fd, NULL); return fsync(vfd->fd) == 0; #else - return FlushFileBuffers((HANDLE) _get_osfhandle(vfd->fd)); + HANDLE h = (HANDLE) _get_osfhandle(vfd->fd); + FILETIME ft; + SYSTEMTIME st; + GetSystemTime(&st); + SystemTimeToFileTime(&st, &ft); + SetFileTime(h, NULL, &ft, &ft); + return FlushFileBuffers(h); #endif }