From 359ebce26ee2223fdd05e8a04f75f15415ec0457 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 22 Feb 2024 17:19:29 -0600 Subject: mtime --- unix.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'unix.go') diff --git a/unix.go b/unix.go index 7d43d54..12ed300 100644 --- a/unix.go +++ b/unix.go @@ -233,6 +233,16 @@ func (rs *RepoStatus) Exists(filename string) bool { return false } +func (rs *RepoStatus) mtime(filename string) (time.Time, error) { + pathf := filepath.Join(rs.Path(), filename) + statf, err := os.Stat(pathf) + if err == nil { + return statf.ModTime(), nil + } + log.Log(REPOWARN, "mtime() error", pathf, err) + return time.Now(), err +} + // returns true if the file exists func Exists(file string) bool { _, err := os.Stat(file) -- cgit v1.2.3