fdupes icon indicating copy to clipboard operation
fdupes copied to clipboard

Use nanosecond-precision timestamps to compare atimes and mtimes

Open S-trace opened this issue 5 years ago • 1 comments

Add int is_first_timespec_newer(struct timespec first, struct timespec second).

Change time_t sorttime to struct timespec sorttimespec.

Change getmtime(char *filename) and getctime(char *filename) to return pointer to newly allocated struct timespec (must be passed to free() after use).

S-trace avatar Jul 07 '19 12:07 S-trace

This breaks cross-platform compatibility; on macOS, there is no struct timespec st_mtim; it's called struct timespec st_mtimespec instead. fdupes isn't ported to Windows but if it ever was, on MinGW compilters, there is no struct timespec in sys/stat.h. On NetBSD there is a fall-through that defines the nanosecond field as long st_mtimensec instead of using struct timespec st_mtim.

jbruchon avatar Jul 07 '19 14:07 jbruchon

Should be fixed by https://github.com/adrianlopezroche/fdupes/commit/8b223d6a2037b6c28d4c00b60dbc9d359309c07f

S-trace avatar Nov 02 '22 21:11 S-trace