summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-12 09:43:23 +0200
committerdefault <nobody@localhost>2023-04-12 09:43:23 +0200
commit93008cfc3e60b09e12fc3e1220602cab3a40b652 (patch)
treefe11fa031804c83c19d51418cf5e3c63266e70df /data.c
parent889f3192dd92a5f599bc5f14bd5b9d5e6a8dd8fc (diff)
New function f_ctime().
Diffstat (limited to 'data.c')
-rw-r--r--data.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/data.c b/data.c
index 50a484f..96ec7f0 100644
--- a/data.c
+++ b/data.c
@@ -249,6 +249,19 @@ double mtime_nl(const char *fn, int *n_link)
}
+double f_ctime(const char *fn)
+/* returns the ctime of a file or directory, or 0.0 */
+{
+ struct stat st;
+ double r = 0.0;
+
+ if (fn && stat(fn, &st) != -1)
+ r = (double) st.st_ctim.tv_sec;
+
+ return r;
+}
+
+
/** database 2.1+ **/
/** indexes **/