mirror of https://github.com/perkeep/perkeep.git
wkfs: make Create use OpenFile(WRONLY) instead of RDWR
Change-Id: Ifbd82b1392a436229fd350a604e1125cf7b1f64d
This commit is contained in:
parent
c5fd9fb7b9
commit
2f4e571e7c
|
@ -56,7 +56,9 @@ func OpenFile(name string, flag int, perm os.FileMode) (FileWriter, error) {
|
|||
return fs(name).OpenFile(name, flag, perm)
|
||||
}
|
||||
func Create(name string) (FileWriter, error) {
|
||||
return OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
|
||||
// like os.Create but WRONLY instead of RDWR because we don't
|
||||
// expose a Reader here.
|
||||
return OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
||||
}
|
||||
|
||||
func fs(name string) FileSystem {
|
||||
|
|
Loading…
Reference in New Issue