From 8cba6c3c24c2122c843aa0feaa26fd6e5c2412e2 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 30 Mar 2025 17:27:52 -0400 Subject: Deprecate built-in Moment datatype in favor of a `time` module --- src/stdlib/paths.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/stdlib/paths.c') 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) -- cgit v1.2.3