forked from TrueCloudLab/rclone
vfs: add a newly created file straight into the directory
This commit is contained in:
parent
1e423d21e1
commit
6150ae89d6
1 changed files with 4 additions and 0 deletions
|
@ -589,6 +589,10 @@ func (f *File) Open(flags int) (fd Handle, err error) {
|
||||||
fs.Errorf(f, "Can't figure out how to open with flags: 0x%X", flags)
|
fs.Errorf(f, "Can't figure out how to open with flags: 0x%X", flags)
|
||||||
return nil, EPERM
|
return nil, EPERM
|
||||||
}
|
}
|
||||||
|
// if creating a file, add the file to the directory
|
||||||
|
if err == nil && flags&os.O_CREATE != 0 {
|
||||||
|
f.d.addObject(f)
|
||||||
|
}
|
||||||
return fd, err
|
return fd, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue