arsenetar / dupeguru

Find duplicate files
https://dupeguru.voltaicideas.net
GNU General Public License v3.0
5.44k stars 415 forks source link

Ignore Invisible Files on Mac #291

Closed truth1ness closed 3 years ago

truth1ness commented 9 years ago

Hi, I want to ignore all Invisible Files on Mac (files starting with a .). Is that possible and if not can that be added?

In particular, my scans are getting clogged up with thousands and thousands of “.DS_Store” files which are all over the place on Macs. The 'ignore files under x size' won't work for me because some of these .DS_Store files are larger than the files I'm scanning for duplicates.

So how could I accomplish either ignoring Invisible Files or ".DS_Store" files in particular?

ghost commented 9 years ago

I thought I'd tell you that your best bet was post scan filtering, but even with the Regular Expression search option, it's not possible to search with ^ and $ (starts with and ends with).

Your best option would be to, after your scan is complete, sort the results by Filename. Normally, all your filename starting with a . should be grouped together, making it easy for you to remove them all at once.

truth1ness commented 9 years ago

Thanks. Could you add an option to ignore it before the scan? The .ds_store files in the directory I'm de-duping (has many thousands of folders) takes about 15-20+ minutes just matching useless .ds_store files for no reason. It's a lot of wasted time and time hanging up my whole computer and makes it extremely difficult and slow to use on high folder count directories. I might have 1 or zero real duplicate and 7 thousand .ds_stores after wasting a ton of time processing. Thanks.

ghost commented 9 years ago

Me, probably not, but pull requests are welcome.

truth1ness commented 9 years ago

I'm not familiar with pull requests. Where would I submit that?

I really think ignoring invisible files should be default behavior. It's good usability. These system files are made invisible for a reason and most people don't even know they exist or how to view them. I can't think of any practical reason why I would want to de-dupe invisible files but can think of a dozen why you wouldn't want to touch them which cover 99.9% of the time. Particularly .ds_store files which are on every single folder on mac and have no reason at all to be de-duped! And even there is a use case for de-duping invisibles it would be much easier to make them visible rather than force them to be processed in their invisible state.

ghost commented 9 years ago

There's the github explanation if you're interested, but in short, it means: if you provide the code, I'll be glad to review it and it will add weight to the feature request.

truth1ness commented 9 years ago

Thanks. My programming skill is pretty close to nil but I can give it a wild shot. Which file would I need to look at?

ghost commented 9 years ago

Probably many because you'll also need to add the option in the preference panel. But otherwise, the Directories class is a good place to start.

juhagman commented 8 years ago

I could look into this. Also skipping bundles (like app folders) could be helpful.

ghost commented 8 years ago

@juhagman There's already code to treat bundle as files instead of folders, you might be interested in it: https://github.com/hsoft/dupeguru/blob/master/cocoa/inter/app_se.py#L53

juhagman commented 8 years ago

Thanks, I'll give those a look during the weekend!

arsenetar commented 3 years ago

This can be accomplished with the Exclusion filters that were added awhile ago, they ignore the .DS_Store locations by default and additional entries can be added.