Nov 19, 2007

Batch changing file types/creators

For some reason when downloading files via FTP with Interarchy, all my .html files end up being owned by IE (yuck). Here’s a handy one-liner to fix that (run from the directory containing the errant files). You’ll need the developer tools installed to get SetFile.

find . -name "*.html" | xargs /Developer/Tools/SetFile -c R*ch

This sets the file creator to R*ch, which is BBEdit’s creator code. Of course the *.html can be changed to change other files, like *.txt.

You can also use the -t option to set the file type, for example -t TEXT.

permalink | computing/mac/tips | 2007.11.19-22:33.00