diff options
| author | Jeff Carr <[email protected]> | 2024-02-22 17:19:29 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-22 17:19:29 -0600 |
| commit | 359ebce26ee2223fdd05e8a04f75f15415ec0457 (patch) | |
| tree | aa2e82ec577d9abed0acb9138a43c13d40b76caa /unix.go | |
| parent | cd5f1d9d0f52196d6ea07684a4307369893911bd (diff) | |
mtime
Diffstat (limited to 'unix.go')
| -rw-r--r-- | unix.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) |
