mirror of
https://github.com/restic/restic.git
synced 2025-08-12 11:47:43 +00:00
cache: Add detection code for old cache dirs
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
)
|
||||
|
||||
// File is an open file on a file system.
|
||||
@@ -120,3 +121,12 @@ func RemoveIfExists(filename string) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// Chtimes changes the access and modification times of the named file,
|
||||
// similar to the Unix utime() or utimes() functions.
|
||||
//
|
||||
// The underlying filesystem may truncate or round the values to a less
|
||||
// precise time unit. If there is an error, it will be of type *PathError.
|
||||
func Chtimes(name string, atime time.Time, mtime time.Time) error {
|
||||
return os.Chtimes(fixpath(name), atime, mtime)
|
||||
}
|
||||
|
Reference in New Issue
Block a user