vfs: Fix --no-modtime to not attempt to set modtimes (as documented)

See: https://forum.rclone.org/t/rclone-mount-with-azure-blob-archive-tier/19414
This commit is contained in:
Nick Craig-Wood 2020-09-30 16:06:57 +01:00
parent 0906f8dd3b
commit a86cedbc24

View File

@ -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
}