1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-04 17:43:50 +00:00

fs: Implement --no-update-dir-modtime to disable setting modification times on dirs

This commit is contained in:
Nick Craig-Wood
2024-03-07 16:13:36 +00:00
parent 99acee7ba0
commit 4e07a72dc7
7 changed files with 62 additions and 4 deletions

View File

@@ -2612,6 +2612,11 @@ func CopyDirMetadata(ctx context.Context, f fs.Fs, dst fs.Directory, dir string,
// It does not create the directory.
func SetDirModTime(ctx context.Context, f fs.Fs, dst fs.Directory, dir string, modTime time.Time) (newDst fs.Directory, err error) {
logName := dirName(f, dst, dir)
ci := fs.GetConfig(ctx)
if ci.NoUpdateDirModTime {
fs.Debugf(logName, "Skipping set directory modification time as --no-update-dir-modtime is set")
return nil, nil
}
if SkipDestructive(ctx, logName, "set directory modification time") {
return nil, nil
}