diff options
| -rw-r--r-- | data.c | 13 | ||||
| -rw-r--r-- | snac.h | 1 |
2 files changed, 14 insertions, 0 deletions
| @@ -249,6 +249,19 @@ double mtime_nl(const char *fn, int *n_link) | |||
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | 251 | ||
| 252 | double f_ctime(const char *fn) | ||
| 253 | /* returns the ctime of a file or directory, or 0.0 */ | ||
| 254 | { | ||
| 255 | struct stat st; | ||
| 256 | double r = 0.0; | ||
| 257 | |||
| 258 | if (fn && stat(fn, &st) != -1) | ||
| 259 | r = (double) st.st_ctim.tv_sec; | ||
| 260 | |||
| 261 | return r; | ||
| 262 | } | ||
| 263 | |||
| 264 | |||
| 252 | /** database 2.1+ **/ | 265 | /** database 2.1+ **/ |
| 253 | 266 | ||
| 254 | /** indexes **/ | 267 | /** indexes **/ |
| @@ -60,6 +60,7 @@ void srv_archive_error(const char *prefix, const xs_str *err, | |||
| 60 | 60 | ||
| 61 | double mtime_nl(const char *fn, int *n_link); | 61 | double mtime_nl(const char *fn, int *n_link); |
| 62 | #define mtime(fn) mtime_nl(fn, NULL) | 62 | #define mtime(fn) mtime_nl(fn, NULL) |
| 63 | double f_ctime(const char *fn); | ||
| 63 | 64 | ||
| 64 | int index_add(const char *fn, const char *md5); | 65 | int index_add(const char *fn, const char *md5); |
| 65 | int index_gc(const char *fn); | 66 | int index_gc(const char *fn); |