aboutsummaryrefslogtreecommitdiff
path: root/src/Storage.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-05 17:36:54 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-05 17:36:54 +0200
commitd7a681b69153ea99f03c128fce5d297ff1f635f6 (patch)
tree83e446359b316adbe57ce618c773d27dc88a1cd6 /src/Storage.cpp
parentcbcdbdbf488b73120b2b604343ac64213cdbb1f8 (diff)
Fix incorrect times, add time to manga history
Diffstat (limited to 'src/Storage.cpp')
-rw-r--r--src/Storage.cpp9
1 files changed, 9 insertions, 0 deletions
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) {