Attempts to get file writes working properly again
This commit is contained in:
parent
aeb0822714
commit
ec4e931f68
2
dir.go
2
dir.go
@ -95,7 +95,7 @@ func (vd *verDir) createFile(name string, flags fuse.OpenFlags) (*verFile, *verF
|
||||
node := newVerNode(childPath, vd.node.ver, nil, NodeFlagVer)
|
||||
file := newVerFile(node, vd)
|
||||
|
||||
handle, err := file.open(flags)
|
||||
handle, err := file.open(flags, true)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
7
file.go
7
file.go
@ -62,14 +62,15 @@ func (vf *verFile) version() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (vf *verFile) open(flags fuse.OpenFlags) (*verFileHandle, error) {
|
||||
if !flags.IsReadOnly() {
|
||||
func (vf *verFile) open(flags fuse.OpenFlags, create bool) (*verFileHandle, error) {
|
||||
if !create && !flags.IsReadOnly() {
|
||||
if err := vf.version(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
path := vf.node.rebasedPath()
|
||||
|
||||
handle, err := os.OpenFile(path, int(flags), 0644)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -105,7 +106,7 @@ func (vf *verFile) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *
|
||||
|
||||
// NodeOpener
|
||||
func (vf *verFile) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error) {
|
||||
handle, err := vf.open(req.Flags)
|
||||
handle, err := vf.open(req.Flags, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user