In Snow Leopard, how do I make hidden directories visible?

4

1

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.

Paul D. Waite

Posted 2009-10-10T14:32:17.673

Reputation: 4 864

Answers

4

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

wfaulk

Posted 2009-10-10T14:32:17.673

Reputation: 5 692

I was wondering how to read the long output of xattr, i.e. how did you know what the extended attribute looks like for an invisible dir - is there a manpage for that? – 0sh – 2011-08-15T22:54:59.847

Found it here, page 13.

– 0sh – 2011-08-15T23:29:43.967

Excellent, thank you. Note that SetFile is part of the Developer Tools, so you’ll need to have those installed. – Paul D. Waite – 2009-10-10T15:13:04.330

Oh, good call on the Developer Tools. – wfaulk – 2009-10-10T15:36:17.410

2

Why not using chflags as SefFile comes only with Xcode?

chflags hidden path_to_file
chflags nohidden path_to_file

jichi

Posted 2009-10-10T14:32:17.673

Reputation: 121

Nice one, good to have a non-Developer Tools option. And welcome to Superuser. – Paul D. Waite – 2012-04-20T07:42:16.067