From 7d2f35f7f976cc29baf22fd0d4d1d58fc870ce64 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 13 May 2017 02:51:05 +0200 Subject: windows-stat-timespec: New module. * modules/windows-stat-timespec: New file. * m4/windows-stat-timespec.m4: New file. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Set WINDOWS_STAT_TIMESPEC. * modules/sys_stat (Makefile.am): Substitute WINDOWS_STAT_TIMESPEC. * lib/sys_stat.in.h (struct stat) [WINDOWS_STAT_TIMESPEC]: Declare with fields st_atim, st_mtim, st_ctim. (st_atime, st_mtime, st_ctime): Define as macros. (_GL_WINDOWS_STAT_TIMESPEC): New macro. * lib/stat-w32.h (_gl_convert_FILETIME_to_timespec) [_GL_WINDOWS_STAT_TIMESPEC]: New declaration. * lib/stat-w32.c (_gl_convert_FILETIME_to_timespec) [_GL_WINDOWS_STAT_TIMESPEC]: New function. (_gl_convert_FILETIME_to_POSIX): Adjust coding style. (_gl_fstat_by_handle): If _GL_WINDOWS_STAT_TIMESPEC, convert the FILETIME to 'struct timespec', not 'time_t'. * lib/stat.c (rpl_stat): If _GL_WINDOWS_STAT_TIMESPEC, convert the FILETIME to 'struct timespec', not 'time_t'. * lib/stat-time.h (STAT_TIMESPEC): Define also if _GL_WINDOWS_STAT_TIMESPEC. * doc/windows-stat-timespec.texi: New file. * doc/gnulib.texi: Include it. --- doc/windows-stat-timespec.texi | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/windows-stat-timespec.texi (limited to 'doc/windows-stat-timespec.texi') diff --git a/doc/windows-stat-timespec.texi b/doc/windows-stat-timespec.texi new file mode 100644 index 0000000000..8aebafc222 --- /dev/null +++ b/doc/windows-stat-timespec.texi @@ -0,0 +1,13 @@ +@node Precise file timestamps on Windows +@section Precise file timestamps on Windows + +The module @samp{windows-stat-timespec} ensures that, +on native Windows platforms, @code{struct stat} contains +@code{st_atim}, @code{st_mtim}, @code{st_ctim} fields of type +@code{struct timespec}, providing 100 ns resolution for the timestamps +of files. + +Note: On some types of file systems, the timestamp resolution is limited +by the file system. For example, on FAT file systems, @code{st_mtim} +only has a resolution of 2 seconds. For more details, see +@url{https://msdn.microsoft.com/en-us/library/ms724290.aspx}. -- cgit v1.2.1