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: Fix --no-modtime to not attempt to set modtimes (as documented)

Nick Craig-Wooda86cedbc243b
diff --git a/vfs/file.go b/vfs/file.go
index eb1103cd3..c3e58311c 100644
--- a/vfs/file.go
+++ b/vfs/file.go
@@ -342,9 +342,14 @@ func (f *File) Size() int64 {
}
// SetModTime sets the modtime for the file
+//
+// if NoModTime is set then it does nothing
func (f *File) SetModTime(modTime time.Time) error {
f.mu.Lock()
defer f.mu.Unlock()
+ if f.d.vfs.Opt.NoModTime {
+ return nil
+ }
if f.d.vfs.Opt.ReadOnly {
return EROFS
}