wkfs: make Create use OpenFile(WRONLY) instead of RDWR

Change-Id: Ifbd82b1392a436229fd350a604e1125cf7b1f64d
This commit is contained in:
Brad Fitzpatrick 2014-08-08 10:14:10 -07:00
parent c5fd9fb7b9
commit 2f4e571e7c
1 changed files with 3 additions and 1 deletions

View File

@ -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 {