operations.DeleteFile
does not use --backup-dir
, despite comment
#7566
Labels
operations.DeleteFile
does not use --backup-dir
, despite comment
#7566
The associated forum post URL from
https://forum.rclone.org
https://forum.rclone.org/t/combine-remote-decrypts-files-when-moving-to-backup-dir-expected/43986
What is the problem you are having with rclone?
The comment for
operations.DeleteFile
is incorrect. It states that--backup-dir
is respected, but in fact, the only possible outcome is forbackupDir
to benil
.rclone/fs/operations/operations.go
Lines 489 to 495 in 519fe98
Some of its callers should probably be using
backupDir
, and so should probably be callingoperations.DeleteFileWithBackupDir
instead.operations.DeleteFileWithBackupDir
requires callers to have already looked up the backupDir withoperations.BackupDir
which is a relatively expensive operation, so it should be done outside the loop when it is necessary.ncw's suggested fix, which LGTM:
operations.DeleteFile
alone but fix the comment to say callDeleteFileWithBackupDir
if--backup-dir
support is requiredDeleteFileWithBackupDir
noting that you useBackupDir
to find the--backup-dir
and that it is relatively expensive so don't put it in a loopoperations.DeleteFile
and try to figure out whether they should be obeying--backup-dir
or not.How to use GitHub
The text was updated successfully, but these errors were encountered: