Need Help with xattr

I normally try to avoid cross-posting, but in this case I need help with xattr on an issue that I originally posted in the Leopard Account & Login section:

http://discussions.apple.com/message.jspa?messageID=11125212

Thanks for any help.

MacBook 2.0 GHz, Mac OS X (10.5.8)

Posted on Feb 27, 2010 5:15 AM

Reply
9 replies

Feb 27, 2010 2:59 PM in response to red_menace

red_menace wrote:
Using the -w option doesn't write the value?
xattr -w com.apple.FinderInfo 32 /some/file


That looks like one of those elegant and should-have-been-obvious solutions, but when I tried it, the result was

[Errno 34] Result too large: '/some/file'
(with "/some/file" substituted with the actual file name). (It turns out that the errno value 34 actually means "Result too large".) I was positioned in the /Applications directory. The file name is 16 characters long. It contains a space, which I escaped with a back-slash.

Feb 27, 2010 3:50 PM in response to William-Boyd-Jr

Ewww - You were right, it isn't a very friendly format to use. The number after the attribute appears to just be the number of bytes in the attribute.

The com.apple.FinderInfo attribute seems to only take a hex string (putting in a text string gives different results) of exactly 32 values, otherwise it gives you the "Result is too large" error. The hex value (well, as much as I can see with the files I have) is composed of a 4 character file type, 4 character file creator, and is padded with nulls out to the 32 byte value, so this particular attribute doesn't look like something that would be used for parental controls, especially since the file type/creator codes are being phased out.

By the way, the com.apple.FinderInfo attribute for a text file (type TEXT creator R*ch) would be set with something like:
xattr -wx com.apple.FinderInfo '54 45 58 54 52 2A 63 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' /some/text/file

Feb 27, 2010 4:34 PM in response to William-Boyd-Jr

Did you give GetFileInfo a try? You have to read the "man GetFileInfo" man page to decode the flag values (capital letter says attribute is set, lowercase says attribute is not set).

I think you will find that the information displayed by GetFileInfo is the same as is in com.apple.FinderInfo

The following MacOSXHints forum posting may be helpful, expecially if you compare the com.apple.FinderInfo break downs posted against the contents of the "man GetFileInfo" man page.
<http://forums.macosxhints.com/showthread.php?t=97984>

Having said all this, I'm not sure com.apple.FinderInfo has anything to do with parental controls. But then again, I do not know how parental controls work 🙂

Feb 27, 2010 6:45 PM in response to BobHarris

BobHarris wrote:
Did you give GetFileInfo a try? You have to read the "man GetFileInfo" man page to decode the flag values (capital letter says attribute is set, lowercase says attribute is not set).


The computer with that application is unavailable at the moment. (The kid that uses it is going to bed.) I'll try to check it in the morning.

The following MacOSXHints forum posting may be helpful, expecially if you compare the com.apple.FinderInfo break downs posted against the contents of the "man GetFileInfo" man page.
< http://forums.macosxhints.com/showthread.php?t=97984 >


The bits that are on in that value seem to correspond to positions for kHasNoINITs, kIsStationery, and kHasBundle. I'm not sure if any of those attributes could have anything to do with my issue.

Feb 28, 2010 4:05 AM in response to William-Boyd-Jr

I have lots of apps which do not have any extended attributes but do apper in the Parental Control's app list. Actually, I can't find any app which does not apper in the list. Are you sure your newly installed app does not apper in the list? The app's name in the list is not necessarily the same as the name in the Finder. Are there any possibilities that the app appears not in the "others" but in other categories?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Need Help with xattr

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.