summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/util.c b/util.c
index 6d79f5d..d1858e0 100644
--- a/util.c
+++ b/util.c
@@ -126,6 +126,16 @@ int util_getUnixDatetime () {
}
/**
+ * Get the last modified datetime
+ * of the file at path
+ */
+time_t util_getMTime (char *path) {
+ struct stat st;
+ if (stat(path, &st) != 0) return -1;
+ else return st.st_mtime;
+}
+
+/**
* Convenience function to get current time as uint64_t.
*
* @return