adrianlopezroche / fdupes

FDUPES is a program for identifying or deleting duplicate files residing within specified directories.
2.43k stars 187 forks source link

--minsize not working when recursing into directories #128

Closed valentijnscholten closed 4 years ago

valentijnscholten commented 4 years ago

The --minsize and --maxsize are very useful and the primary reason for me to build my own binary with these unreleased features.

However they don't work when recursing into (sub)directories.

On my filesystem directories are 4096 bytes, so any value for minsize above that will skip the directory, basically skipping everything.

example commands: ./fdupes -r /hd6/backup --minsize=4097 ./fdupes -R /hd6/backup --minsize=4097

will skip all directories inside /hd6/backup because they are only 4096 bytes.

I am not a C(++) programmer so can't easily provide a reliable PR, but at first thought the size check should not be performed for directories I think?

adrianlopezroche commented 4 years ago

You're right, directory sizes should be ignored completely. Thanks for the bug report.

On Sat, Dec 28, 2019, 10:52 AM valentijnscholten notifications@github.com wrote:

The --minsize and --maxsize are very useful and the primary reason for me to build my own binary with these unreleased features.

However they don't work when recursing into (sub)directories.

On my filesystem directories are 4096 bytes, so any value for minsize above that will skip the directory, basically skipping everything.

example command: ./fdupes -r /hd6/backup --minsize=4097

will skip all directories inside /hd6/backup because they are only 4096 bytes.

I am not a C(++) programmer so can't easily provide a reliable PR, but at first thought the size check should not be performed for directories I think?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adrianlopezroche/fdupes/issues/128?email_source=notifications&email_token=ABPQT7OY6UO2YJNFLKUCGULQ25R4BA5CNFSM4KANXJLKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IDAQXXQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPQT7P2FQRQKYE5TQVBRTTQ25R4BANCNFSM4KANXJLA .

valentijnscholten commented 4 years ago

As a programmer I couldn't help myself and try to make it work :)

See https://github.com/adrianlopezroche/fdupes/pull/129.

The size check should maybe also be skipped for symlinks, I don't know.

adrianlopezroche commented 4 years ago

For symlinks I think it should use the size of the file it points to.

On Sat, Dec 28, 2019, 11:57 AM valentijnscholten notifications@github.com wrote:

As a programmer I couldn't help myself and try to make it work :)

See #129 https://github.com/adrianlopezroche/fdupes/pull/129.

The size check should maybe also be skipped for symlinks, I don't know.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adrianlopezroche/fdupes/issues/128?email_source=notifications&email_token=ABPQT7LPK2RRNP5UADSNA5DQ25ZPTA5CNFSM4KANXJLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYMQQI#issuecomment-569428033, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPQT7KSKIRMFKO7QHMKSRDQ25ZPTANCNFSM4KANXJLA .

adrianlopezroche commented 4 years ago

Fixed by 7ad4c5c476383163b45533c622d0e54a8146bc6b.