diff options
| author | CiD- <jkercher43@gmail.com> | 2022-04-01 22:41:35 -0400 |
|---|---|---|
| committer | CiD- <jkercher43@gmail.com> | 2022-04-01 22:41:35 -0400 |
| commit | 88de3a1c0633761e2f73f4e576a0dfd2bb9c32bf (patch) | |
| tree | 4c6b77281d88fa86b17c69e1847d74a7e6224c89 /core/os | |
| parent | 645661889137f6f4cb96b9671976dbc006345497 (diff) | |
add _chtimes
Diffstat (limited to 'core/os')
| -rw-r--r-- | core/os/os2/file_linux.odin | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/os/os2/file_linux.odin b/core/os/os2/file_linux.odin index 3202b9e16..89075e00c 100644 --- a/core/os/os2/file_linux.odin +++ b/core/os/os2/file_linux.odin @@ -27,6 +27,8 @@ _O_SYNC :: 0o4010000 _O_CLOEXEC :: 0o2000000 _O_PATH :: 0o10000000 +_AT_FDCWD :: -100 + _open :: proc(name: string, flags: File_Flags, perm: File_Mode) -> (Handle, Error) { cstr := strings.clone_to_cstring(name, context.temp_allocator) @@ -250,8 +252,12 @@ _lchown :: proc(name: string, uid, gid: int) -> Error { } _chtimes :: proc(name: string, atime, mtime: time.Time) -> Error { - //TODO - return nil + name_cstr := strings.clone_to_cstring(name, context.temp_allocator) + times := [2]Unix_File_Time { + { atime._nsec, 0 }, + { mtime._nsec, 0 }, + } + return _ok_or_error(unix.sys_utimensat(_AT_FDCWD, name_cstr, ×, 0)) } _exists :: proc(name: string) -> bool { |