mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 14:56:29 +00:00
f4282aa6fd
This is intended to prevent accidental modifications of data files. Marking the files as read-only was accidentally removed in #1258.
15 lines
209 B
Go
15 lines
209 B
Go
// +build !windows
|
|
|
|
package local
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/restic/restic/internal/fs"
|
|
)
|
|
|
|
// set file to readonly
|
|
func setFileReadonly(f string, mode os.FileMode) error {
|
|
return fs.Chmod(f, mode&^0222)
|
|
}
|