mirror of
https://github.com/restic/restic.git
synced 2025-12-24 00:16:31 +00:00
Create setNewFileMode function.
Create separate files with setNewFileMode to avoid runtime checks.
This commit is contained in:
12
backend/local/local_unix.go
Normal file
12
backend/local/local_unix.go
Normal file
@@ -0,0 +1,12 @@
|
||||
// +build !windows
|
||||
|
||||
package local
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// set file to readonly
|
||||
func setNewFileMode(f string, fi os.FileInfo) error {
|
||||
return os.Chmod(f, fi.Mode()&os.FileMode(^uint32(0222)))
|
||||
}
|
||||
Reference in New Issue
Block a user