[OS X TeX] texshop icon
P.Vamos at exeter.ac.uk
Mon Jun 4 11:49:21 CEST 2012
On my desktop iMac Snow Leopard system my TexShop owned .tex files exhibit the following behaviour. (My Lion laptop seems identical.)
Of the four icon views I see the TS icon in all *except* in icon view so this is what I will report on below.
I have folders where I see the TS LaTeX icon, let's call them iconic folders and in others I only see the generic icon let's call these iconless. Moving a .tex file between these folders the icon appears/disappears depending on the enclosing folder. I tried the remedies suggested in this and in a previous thread and they had no effect on this behaviour. But here is the (first) strange thing: when I set the slider controlling the size of the icon in an iconless folder to min then the icons appear! Nudging the slider to the right, one can see a point where the icon changes to generic. This does not happen in an iconic folder. So it seems that (on my system at least) this behaviour is determined by some property of the enclosing folder.
Get info shows that the permissions differ on these two kinds of folder.
Iconless: group (staff/wheel) read only, everyone read only; Iconic: both group and everyone is set to `Custom' (???).
Going to terminal reveals more (ls -l).
Iconless: drwxr-xr-x Iconic: drwxrw-rw-@
Notice the @ at the end of the Iconic. This means that iconic folders have an xattr (Extended Attribute) set. This, I believe, came in with Tiger. So what is this attribute? Issuing the ls -l@ command gives nothing new for iconless of course but reports for Iconic (for the folder named charalg):
drwxrw-rw-@ 26 peterv staff 884 3 Jun 00:58 charalg
So the attribute's name is com.apple.FinderInfo and it is 32 bits long. You can get the value of this using getxattr. (I also noticed that some files have the com.apple.ResourceFork attribute.)
All this suggests to me the following hack/patch: set the xattr of an Iconless folder to that of an Iconic to make the latter Iconic. There is in fact an example on how to do this in the man pages for Lion only using xattr - presumably you could do it in Snow leopard with setxattr and getxattr. I tried the example on my Lion laptop but got error messages. At this stage my time and patience ran out - maybe someone more knowledgable/competent with Unix and the terminal can try to verify this conjecture.
All the above still leave the following questions:
How did my Iconic folders get their extended attributes in the first place? (Pre Tiger legacy folders?)
Why do TS icons need the folder to have this extended attribute (at least on my set-up)?
More information about the macostex-archives