HFS+ Attributes - commands

I was just on digg and seen that there was article for lists of commands for every OS and i looked at the OSX section and seen 2 commands that took my interest, GetFileInfo and SetFile. These are in the /Developer/Tools folder so if you have dev tools installed you can add these to your path by adding this to your .profile

export PATH=$PATH:/Developer/Tools

i don’t know how this got past me for so long. but you can do the following with SetFile, using an uppercase Letter to set that bitfield to true and a lowercase to set to false. so a line like the following will set the extension to true

SetFile -a E myfile.txt

and a list of attributes to use
A Alias file
B Bundle
C Custom icon*
D Desktop*
E Hidden extension*
I Inited*
M Shared (can run multiple times)
N No INIT resources
L Locked
S System (name locked)
T Stationery
V Invisible*
Z Busy*

GetFileInfo is similar but returns true/false of the queried field.
the following will return whether the field the extension is hidden or not (1 = hidden extension, 0 = visible extension )
GetFileInfo -ae someFile.txt

Just thought i would share this with everyone else here, if you didn’t already know.