Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 http://superuser.com/questions/53383/), but I’d like to make the directories themselves be not hidden.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

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
share|improve this answer
    
Excellent, thank you. Note that SetFile is part of the Developer Tools, so you’ll need to have those installed. –  Paul D. Waite Oct 10 '09 at 15:13
    
Oh, good call on the Developer Tools. –  wfaulk Oct 10 '09 at 15:36
    
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 Aug 15 '11 at 22:54
    
Found it here, page 13. –  0sh Aug 15 '11 at 23:29
add comment

Why not using chflags as SefFile comes only with Xcode?

chflags hidden path_to_file
chflags nohidden path_to_file
share|improve this answer
    
Nice one, good to have a non-Developer Tools option. And welcome to Superuser. –  Paul D. Waite Apr 20 '12 at 7:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.