cache: Add detection code for old cache dirs

This commit is contained in:
Alexander Neumann
2017-11-20 21:32:25 +01:00
parent 06bd606d85
commit fa893ee477
3 changed files with 74 additions and 3 deletions

View File

@@ -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)
}