1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

vfs: add --vfs-metadata-extension to expose metadata sidecar files

This adds --vfs-metadata-extension which can be used to expose sidecar
files with file metadata in. These files don't exist in the listings
until they are accessed.
This commit is contained in:
Nick Craig-Wood
2025-02-28 17:01:29 +00:00
parent b587b094c9
commit 533c6438f3
6 changed files with 207 additions and 1 deletions

View File

@@ -900,3 +900,15 @@ func (vfs *VFS) Symlink(oldname, newname string) error {
_, err := vfs.CreateSymlink(oldname, newname)
return err
}
// Return true if name represents a metadata file
//
// It returns the underlying path
func (vfs *VFS) isMetadataFile(name string) (rawName string, found bool) {
ext := vfs.Opt.MetadataExtension
if ext == "" {
return name, false
}
rawName, found = strings.CutSuffix(name, ext)
return rawName, found
}