summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-04-15 23:57:50 -0700
committerMichael Pavone <pavone@retrodev.com>2016-04-15 23:57:50 -0700
commitf76ba81c317fdca5f549bcb044d62861609fe6d1 (patch)
tree0dc9bed8def723181a9655c27886fcc27dccb5d3 /util.c
parente913f115a678bf2eb0da3a0c6b2ab45830f79028 (diff)
Save state menu WIP
Diffstat (limited to 'util.c')
-rw-r--r--util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util.c b/util.c
index 9094223..1e3cfe8 100644
--- a/util.c
+++ b/util.c
@@ -366,6 +366,15 @@ void free_dir_list(dir_entry *list, size_t numentries)
free(list);
}
+time_t get_modification_time(char *path)
+{
+ struct stat st;
+ if (stat(path, &st)) {
+ return 0;
+ }
+ return st.st_mtim.tv_sec;
+}
+
int ensure_dir_exists(char *path)
{
struct stat st;