This is working for me:
-
On macOS 13.1, I create a test.txt
file:
% touch /Users/quinn/test.txt
-
I ran eslogger
just like you:
% sudo eslogger utimes
-
In Xcode 14.2, I created a tiny test project that calls utimes
on /Users/quinn/test.txt
. The code is below.
-
I ran that directly from Xcode.
-
Back in Terminal, I saw this output from eslogger
:
% sudo eslogger utimes
{"schema_version":1,"mach_time":73743136883893,"event_type":59,"thread":{"thread_id":788321},"version":6,"seq_num":0,"event":{"utimes":{"target":{"path":"\/Users\/quinn\/test.txt","stat":{"st_blocks":0,"st_blksize":4096,"st_rdev":0,"st_dev":16777222,"st_uid":502,"st_gid":20,"st_ino":148323735,"st_birthtimespec":"2023-01-19T09:43:42.460731222Z","st_flags":0,"st_nlink":1,"st_mtimespec":"2023-01-19T09:43:46.467810000Z","st_ctimespec":"2023-01-19T09:43:46.467830846Z","st_size":0,"st_gen":0,"st_mode":33188,"st_atimespec":"2023-01-19T09:43:46.467810000Z"},"path_truncated":false},"atime":"2023-01-19T09:47:13.751173000Z","mtime":"2023-01-19T09:47:13.751173000Z"}},"time":"2023-01-19T09:47:13.751275909Z","action":{"result":{"result":{"auth":0},"result_type":0}},"process":{"signing_id":"xxst","parent_audit_token":{"asid":100006,"pidversion":54979,"ruid":502,"euid":502,"rgid":20,"auid":502,"egid":20,"pid":22626},"codesigning_flags":1912680500,"executable":{"path":"\/Users\/quinn\/Library\/Developer\/Xcode\/DerivedData\/xxst-gbdxgtdgxlnkwzaeesxwcecwxoqj\/Build\/Products\/Debug\/xxst","stat":{"st_blocks":352,"st_blksize":4096,"st_rdev":0,"st_dev":16777222,"st_uid":502,"st_gid":20,"st_ino":148324253,"st_birthtimespec":"2023-01-19T09:47:03.184631587Z","st_flags":0,"st_nlink":1,"st_mtimespec":"2023-01-19T09:47:03.524563320Z","st_ctimespec":"2023-01-19T09:47:03.524654654Z","st_size":176704,"st_gen":0,"st_mode":33261,"st_atimespec":"2023-01-19T09:47:13.750991749Z"},"path_truncated":false},"ppid":22626,"tty":null,"start_time":"2023-01-19T09:47:11.279286Z","is_platform_binary":false,"group_id":22623,"audit_token":{"asid":100006,"pidversion":54977,"ruid":502,"euid":502,"rgid":20,"auid":502,"egid":20,"pid":22623},"is_es_client":false,"responsible_audit_token":{"asid":100006,"pidversion":54977,"ruid":502,"euid":502,"rgid":20,"auid":502,"egid":20,"pid":22623},"session_id":3539,"original_ppid":3539,"cdhash":"00CBA2674B94C4CBA8AB0754F6199A3362DFF271","team_id":"SKMME9E2Y8"},"action_type":1,"global_seq_num":0}
^C
Please try these steps in your environment and let me know what you get.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
import Foundation
func main() {
let u = URL(fileURLWithPath: "/Users/quinn/test.txt")
print("will set times")
let success = utimes(u.path, nil) >= 0
guard success else {
print("did not set times")
return
}
print("did set times")
}
main()