I want to get the last modified date of a file in C. Almost all sources I found use something along this snippet:
char *get_last_modified(char *file) { s
On OS X, st_mtimespec.tv_sec is the equivalent of st_mtime.
st_mtimespec.tv_sec
st_mtime
To make this portable, do
#ifdef __APPLE__ #ifndef st_mtime #define st_mtime st_mtimespec.tv_sec #endif #endif
and then use st_mtime.