diff options
Diffstat (limited to 'src/fileutils.c')
-rw-r--r-- | src/fileutils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fileutils.c b/src/fileutils.c index d7021dc..48cf825 100644 --- a/src/fileutils.c +++ b/src/fileutils.c @@ -52,6 +52,15 @@ int file_get_content(const char *filepath, char **data, long *size) { return result; } +int file_get_last_modified_time(const char *path, time_t *last_modified) { + struct stat s; + if(stat(path, &s) == 0) { + *last_modified = s.st_mtim.tv_sec; + return 0; + } + return -1; +} + int create_directory_recursive(char *path) { int path_len = strlen(path); char *p = path; |