diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-07 07:38:59 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-07 07:38:59 +0200 |
commit | 48e757baffbf75bc8a1e4171ad94c27d7356cafa (patch) | |
tree | 91cad8a939725bd3a52bf2bc726620d164d64a57 /src/fileutils.c | |
parent | 52c63554190b8421c6f2db72d490f50364a2e23d (diff) |
Migrate mangadex to new api, remove .in_progress files in tracked dir if they are old
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; |