From 48e757baffbf75bc8a1e4171ad94c27d7356cafa Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 7 May 2021 07:38:59 +0200 Subject: Migrate mangadex to new api, remove .in_progress files in tracked dir if they are old --- src/fileutils.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/fileutils.c') 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; -- cgit v1.2.3