diff options
Diffstat (limited to 'fileset.c')
-rw-r--r-- | fileset.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -186,7 +186,19 @@ fileset_update_file(const char *path) if (entry_list) { entry = (fileset_entry *) entry_list->data; +#ifdef __WIN32 + /* Microsoft's documentation says this is the creation time */ entry->ctime = buf.st_ctime; +#else /* _WIN32 */ + /* UN*X - do we have a creation time? */ +#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIME) + entry->ctime = buf.st_birthtime; +#elif defined(HAVE_STRUCT_STAT___ST_BIRTHTIME) + entry->ctime = buf.__st_birthtime; +#else /* nothing */ + entry->ctime = 0; +#endif /* creation time on UN*X */ +#endif /* _WIN32 */ entry->mtime = buf.st_mtime; entry->size = buf.st_size; } @@ -220,7 +232,19 @@ fileset_add_file(const char *dirname, const char *fname, gboolean current) entry->fullname = g_strdup(path); entry->name = g_strdup(fname); +#ifdef __WIN32 + /* Microsoft's documentation says this is the creation time */ entry->ctime = buf.st_ctime; +#else /* _WIN32 */ + /* UN*X - do we have a creation time? */ +#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIME) + entry->ctime = buf.st_birthtime; +#elif defined(HAVE_STRUCT_STAT___ST_BIRTHTIME) + entry->ctime = buf.__st_birthtime; +#else /* nothing */ + entry->ctime = 0; +#endif /* creation time on UN*X */ +#endif /* _WIN32 */ entry->mtime = buf.st_mtime; entry->size = buf.st_size; entry->current = current; |