diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-01-09 14:39:39 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-09 16:55:27 +0000 |
| commit | bc54aa9fe40d6d1ffa6f80a1e04a18689ddbc54c (patch) | |
| tree | 471210fbf516a516aaa4e15e3bbb99d037fb2177 /pkg/osutil/osutil.go | |
| parent | 36eb9783384b89dffb86e2eed340838f1b3ff1c1 (diff) | |
pkg/osutil: fix CreationTime
We return Ctime from CreationTime. But "C" does not stand for "creation",
it stands for "status change" (inode update). It may or may not be the
creation time.
Use Btime (birth time) for creation time.
Fixes #6547
Diffstat (limited to 'pkg/osutil/osutil.go')
| -rw-r--r-- | pkg/osutil/osutil.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index fa963a3fb..d56682732 100644 --- a/pkg/osutil/osutil.go +++ b/pkg/osutil/osutil.go @@ -351,10 +351,9 @@ func Abs(path string) string { return filepath.Clean(path) } -// CreationTime returns file creation time. -// May return zero time, if not known. -func CreationTime(fi os.FileInfo) time.Time { - return creationTime(fi) +// FileTimes returns file creation and modification times. +func FileTimes(file string) (time.Time, time.Time, error) { + return fileTimes(file) } // MonotonicNano returns monotonic time in nanoseconds from some unspecified point in time. |
