[feat] Deep scan module support for __MACOSX folders

Forums: 

I don't have a Mac nor do I know the difference between all the files and folders it creates, but often I get or download files or .zip files from others and I end up with a bunch of __MACOSX directories, containing a lot of hidden .dotfiles. I think this is similar to .trashes.

Should this be added to the global "Deep scan" module?

I have traded some files and a common network with Mac OS X users (though I don't use Mac OS X), but I've never seen those files. I don't know enough about them except they seem not to be popular, so I would prefer not to include them in the core system.

Like other parts of CleanerML, deep scan is extensible, so third parties are welcome to include this as a custom cleaner.

---
Andrew, lead developer

Really, you've never seen them? I have almost exclusively OSX colleagues and I see these often when we exchange files.

Apparently, they get generated when OSX people use the native ZIP client. They get stuck in the ZIP file just as .Trashes and Thums.db do.

http://superuser.com/questions/104500/what-is-macosx-folder

Anyway, can you point me to an example or documentation about how to extend the deep scan menu item?

First, look at the deepscan.xml file included with BleachBit. You should copy it and change the ID from deepscan to something else like custom-deepscan.

Second, there is the CleanerML documentation

This should be easy to adapt for matching file names, but it may not work for matching folder names (in BleachBit version 0.9.5).

---
Andrew, lead developer

I have not had any Apple encounters so I still cannot see if this does what I expect it to do on sticks and external drives.

But for reference sake:


<?xml version="1.0" encoding="UTF-8"?>
<!--
Custom deepscan for BleachBit by Redsandro
License: GPL3+
-->
<cleaner id="rs-deepscan">
<label translate="true">Deep scan</label>
<option id="apple_crap">
<label>Apple leftovers</label>
<description>Delete stuff Apple leaves behind.</description>
<warning>This option is slow.</warning>
<action command="delete" search="deep" cache="false" regex="^\.DS_Store$"/>
<action command="delete" search="deep" cache="false" regex="^\.Trashes$"/>
<action command="delete" search="deep" cache="false" regex="^\.Spotlight-V100$"/>
<action command="delete" search="deep" cache="false" regex="^\__MACOSX$"/>
</option>
</cleaner>