Macos – In Snow Leopard, how to make hidden directories visible

ipodmacos

I’ve got some folders that I copied from a friend’s old iPod. (They’re the F00, F01 folders that the old iPod used to store music files).

On my Mac (running Snow Leopard), they’re hidden in the Finder, and invisible to Python’s glob module.

I’d like to stop them being hidden, permanently. I know I can make the Finder show hidden files (see How can I show hidden files/folders in Finder), but I’d like to make the directories themselves be not hidden.

Best Answer

From Terminal.app:

SetFile -a v F00 F01

You can see the raw attribute data with:

xattr -l F00 F01

SetFile is in the Developer Tools package. If you can't install that, you can try to manipulate the extended attributes directly using xattr.

A directory whose only extended attribute is invisibility looks like this:

com.apple.FinderInfo:
00000000  00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  |........@.......|
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|

If your xattr output matches that, you should be safe just deleting the com.apple.FinderInfo attribute:

xattr -d com.apple.FinderInfo F00

If it doesn't exactly match, you should be safe rewriting the attribute after subtracting that '4' from that position:

mac% xattr -l F00
com.apple.FinderInfo:
00000000  00 00 00 00 00 00 00 00 40 10 00 00 00 00 00 00  |........@.......|
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
00000020
mac% xattr -wx com.apple.FinderInfo 0000000000000000001000000000000000000000000000000000000000000000 F00
mac% xattr -l chgfndrcom.apple.FinderInfo:
00000000  00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
00000020