backend: consistently use os package for filesystem access

The go std library should be good enough to manage the files in the
backend and cache folders.
This commit is contained in:
Michael Eischer
2024-07-21 15:22:21 +02:00
parent ca1e5e10b6
commit 24f4e780f1
9 changed files with 33 additions and 50 deletions

View File

@@ -88,15 +88,6 @@ func OpenFile(name string, flag int, perm os.FileMode) (*os.File, error) {
return os.OpenFile(fixpath(name), flag, perm)
}
// 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)
}
// IsAccessDenied checks if the error is due to permission error.
func IsAccessDenied(err error) bool {
return os.IsPermission(err)