forked from TrueCloudLab/restic
Create setNewFileMode function.
Create separate files with setNewFileMode to avoid runtime checks.
This commit is contained in:
parent
dfe232cf46
commit
520b1b65b0
3 changed files with 25 additions and 11 deletions
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)))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue