This commit is contained in:
Kovid Goyal
2025-02-09 14:12:46 +05:30
parent a582de98dc
commit 8e4050b923
3 changed files with 4 additions and 2 deletions

View File

@@ -34,8 +34,6 @@ func (s *StatResult) setup_common(f fs.FileInfo) (u *syscall.Stat_t) {
u = nil
}
if u != nil {
s.Has_atime = true
s.Has_ctime = true
s.Dev = uint64(u.Dev)
s.Ino = uint64(u.Ino)
s.Has_dev = true

View File

@@ -13,6 +13,8 @@ var _ = fmt.Print
func Get(f fs.FileInfo) (ans StatResult) {
u := ans.setup_common(f)
if u != nil {
ans.Has_atime = true
ans.Has_ctime = true
ans.Ctime = time.Unix(u.Ctim.Unix())
ans.Atime = time.Unix(u.Atim.Unix())
}

View File

@@ -13,6 +13,8 @@ var _ = fmt.Print
func Get(f fs.FileInfo) (ans StatResult) {
u := ans.setup_common(f)
if u != nil {
ans.Has_atime = true
ans.Has_ctime = true
ans.Ctime = time.Unix(u.Ctimespec.Unix())
ans.Atime = time.Unix(u.Atimespec.Unix())
}