stat: Show nanosecond part of file timestamps
This commit is contained in:
parent
efaf9f137a
commit
f8290e1ad4
Notes:
sideshowbarker
2024-07-17 04:10:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f8290e1ad4 Pull-request: https://github.com/SerenityOS/serenity/pull/16147 Reviewed-by: https://github.com/Hendiadyoin1
1 changed files with 5 additions and 5 deletions
|
@ -72,16 +72,16 @@ static ErrorOr<int> stat(StringView file, bool should_follow_links)
|
|||
|
||||
outln(")");
|
||||
|
||||
auto print_time = [](time_t t) {
|
||||
outln("{}", Core::DateTime::from_timestamp(t).to_string());
|
||||
auto print_time = [](timespec t) {
|
||||
outln("{}.{:09}", Core::DateTime::from_timestamp(t.tv_sec).to_string(), t.tv_nsec);
|
||||
};
|
||||
|
||||
out("Accessed: ");
|
||||
print_time(st.st_atime);
|
||||
print_time(st.st_atim);
|
||||
out("Modified: ");
|
||||
print_time(st.st_mtime);
|
||||
print_time(st.st_mtim);
|
||||
out(" Changed: ");
|
||||
print_time(st.st_ctime);
|
||||
print_time(st.st_ctim);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue