Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

vfs: add a newly created file straight into the directory

Nick Craig-Wood6150ae89d6d6
diff --git a/vfs/file.go b/vfs/file.go
index 2747e958d..aa0e8c434 100644
--- a/vfs/file.go
+++ b/vfs/file.go
@@ -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)
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
}