From d7a681b69153ea99f03c128fce5d297ff1f635f6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 5 Jun 2021 17:36:54 +0200 Subject: Fix incorrect times, add time to manga history --- src/Storage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Storage.cpp') diff --git a/src/Storage.cpp b/src/Storage.cpp index 85a150c..7103b7a 100644 --- a/src/Storage.cpp +++ b/src/Storage.cpp @@ -118,6 +118,15 @@ namespace QuickMedia { return -1; } + bool file_get_last_modified_time_seconds(const char *path, time_t *result) { + struct stat file_stat; + if(stat(path, &file_stat) == 0) { + *result = file_stat.st_mtim.tv_sec; + return true; + } + return false; + } + static int file_overwrite(const Path &path, const char *str, size_t size) { FILE *file = fopen(path.data.c_str(), "wb"); if(!file) { -- cgit v1.2.3