Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to ignore Icon␍ macOS files? #94

Closed
b-g opened this issue Jul 23, 2022 · 3 comments
Closed

How to ignore Icon␍ macOS files? #94

b-g opened this issue Jul 23, 2022 · 3 comments

Comments

@b-g
Copy link

b-g commented Jul 23, 2022

Many thanks for this great tool!! 🙏 (Not an issue, rather a question.)

Following carefully the great documentation I manged to write a custom sequence to make filenames safe for exFAT formatted volumes. Great! Now just I have trouble with macOS Icon␍ files.

My .detoxrc looks like below ... but I couldn't figure out how to set the ignore filename parameter correctly to actually ignore the macOS Icon␍ files. Some attempts:

sequence exfat_safe {
   safe {filename "/Users/bene/.detox/exfat_safe.tbl";};
};

ignore {
   filename "Icon?";
   filename "Icon␍";
   filename "Icon\0x0D";
   filename "Icon[\r]";
};

Any hints how to achieve this?

@dharple
Copy link
Owner

dharple commented Aug 5, 2022

The detoxrc perser is just looking for a string, so you can't use a shell wildcard, a C escape sequence, or a regex bracket expression.

You can, however, just insert an actual Control-M into the string. It gets really weird, because Control-M affects the way the console works.

$ tail /tmp/detoxrc.sample 

ignore {
	filename ".arch-params";
	filename ".evolution";
	filename ".gnome";
	filename ".mozilla";
	filename ".themes";
	filename "{arch}";
";	filename "Icon
};

Note that the closing quote now appears to be at the start of the line.

Anyway, you should be able to cut and paste it out of this: detoxrc.zip . I tested it to confirm that it will work.

$ mkdir /tmp/test
$ cd /tmp/test
$ touch $(printf "Icon\r") 
$ ls
'Icon'$'\r'
$ detox -f /tmp/detoxrc.sample -nv .
Scanning: .

With the original config file:

$ detox -nv .
Scanning: .
 -> ./Icon_

Note that the original filename in the example above is overwritten due to the Control-M in the filename resetting the cursor position to the start of the line.

@dharple dharple closed this as completed Aug 5, 2022
@dharple
Copy link
Owner

dharple commented Aug 5, 2022

And thank you for the compliment!

@b-g
Copy link
Author

b-g commented Sep 6, 2022

Hi @dharple, Sorry for slow response! Had a little internet detox in the Alps :)

Many thanks for the solution! This works!

For others coming across this esoteric issue:
I couldn't copy and paste the magic Control-M line in my normal code editors e.g. Sublime Text and had to try out a few other editors ... for some weird reason just macOS on-board TextEdit manged to do the trick for me. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants