aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/paths.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-30 17:27:52 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-30 17:27:52 -0400
commit8cba6c3c24c2122c843aa0feaa26fd6e5c2412e2 (patch)
treeae0583da790de2416f03a27e9f94953be7d4a803 /src/stdlib/paths.c
parentd853d7b8dc1586f6b2fad3bf05998bfbe935b8f3 (diff)
Deprecate built-in Moment datatype in favor of a `time` module
Diffstat (limited to 'src/stdlib/paths.c')
-rw-r--r--src/stdlib/paths.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/stdlib/paths.c b/src/stdlib/paths.c
index c7b560b9..05575620 100644
--- a/src/stdlib/paths.c
+++ b/src/stdlib/paths.c
@@ -255,28 +255,28 @@ public bool Path$can_execute(Path_t path)
#endif
}
-public OptionalMoment_t Path$modified(Path_t path, bool follow_symlinks)
+public OptionalInt64_t Path$modified(Path_t path, bool follow_symlinks)
{
struct stat sb;
int status = path_stat(path, follow_symlinks, &sb);
- if (status != 0) return NONE_MOMENT;
- return (Moment_t){.tv_sec=sb.st_mtime};
+ if (status != 0) return NONE_INT64;
+ return (OptionalInt64_t){.value=(int64_t)sb.st_mtime};
}
-public OptionalMoment_t Path$accessed(Path_t path, bool follow_symlinks)
+public OptionalInt64_t Path$accessed(Path_t path, bool follow_symlinks)
{
struct stat sb;
int status = path_stat(path, follow_symlinks, &sb);
- if (status != 0) return NONE_MOMENT;
- return (Moment_t){.tv_sec=sb.st_atime};
+ if (status != 0) return NONE_INT64;
+ return (OptionalInt64_t){.value=(int64_t)sb.st_atime};
}
-public OptionalMoment_t Path$changed(Path_t path, bool follow_symlinks)
+public OptionalInt64_t Path$changed(Path_t path, bool follow_symlinks)
{
struct stat sb;
int status = path_stat(path, follow_symlinks, &sb);
- if (status != 0) return NONE_MOMENT;
- return (Moment_t){.tv_sec=sb.st_ctime};
+ if (status != 0) return NONE_INT64;
+ return (OptionalInt64_t){.value=(int64_t)sb.st_ctime};
}
static void _write(Path_t path, Array_t bytes, int mode, int permissions)