"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
vfs: fix AddVirtual ignoring isDir
phatlcebb1cc122199
diff --git a/vfs/vfs.go b/vfs/vfs.goindex 4d238dc57..ec3761972 100644--- a/vfs/vfs.go+++ b/vfs/vfs.go@@ -901,7 +901,7 @@ func (vfs *VFS) AddVirtual(remote string, size int64, isDir bool) (err error) {if err != nil {return err}- dir.AddVirtual(leaf, size, false)+ dir.AddVirtual(leaf, size, isDir)return nil}diff --git a/vfs/vfs_test.go b/vfs/vfs_test.goindex 96d81fdb9..03613a25e 100644--- a/vfs/vfs_test.go+++ b/vfs/vfs_test.go@@ -249,6 +249,27 @@ func TestVFSStatParent(t *testing.T) {assert.Equal(t, os.ErrExist, err)}+func TestVFSAddVirtual(t *testing.T) {+ _, vfs := newTestVFS(t)++ require.NoError(t, vfs.AddVirtual("file", 17, false))+ node, err := vfs.Stat("file")+ require.NoError(t, err)+ assert.True(t, node.IsFile())+ assert.Equal(t, int64(17), node.Size())++ require.NoError(t, vfs.AddVirtual("dir/", 0, true))+ node, err = vfs.Stat("dir")+ require.NoError(t, err)+ assert.True(t, node.IsDir())++ require.NoError(t, vfs.AddVirtual("dir/file2", 18, false))+ node, err = vfs.Stat("dir/file2")+ require.NoError(t, err)+ assert.True(t, node.IsFile())+ assert.Equal(t, int64(18), node.Size())+}+func TestVFSOpenFile(t *testing.T) {r, vfs := newTestVFS(t)