Command to Apply Extended Attributes?

Is there a command that allow me to apply certain extended attributes to a file? I'm trying to reproduce a situation so that I can report a problem. I'd like to be able to modify the attributes of a file so that it appears this way:


$ ls -l@ some_file.pdf

-rwxrwxrwx@ 1 billb billb 129147 Nov 5 22:14 some_file.pdf

com.apple.metadata:kMDItemDownloadedDate 53

com.apple.metadata:kMDItemWhereFroms 176

com.apple.quarantine 74


Thanks for any suggestions.

MacBook 5,2 2.0 GHz, 4GB RAM, Mac OS X (10.7)

Posted on Nov 12, 2011 1:49 PM

Reply
7 replies

Nov 12, 2011 2:09 PM in response to Kappy

Thanks for the information. I'm familiar with chmod for basic mode modification, but haven't done much with extended attributes or flags. Do you have any tips regarding modifying those "com.apple.metadata" values? The "man" pages for chmod and chflags don't mention those. Some files on my system also have metadata named things like "com.apple.Preview.UIstate.v1". I found the "mdls" command, but it's not obvious to me that mdls concerns itself with "com." items.

Nov 12, 2011 2:29 PM in response to Kappy

Kappy wrote:


it's never a good idea to modify the permissions of OS X system files, but then you already know that. 🙂

Right. The files I want to modify are my own. I'm trying to recreate at will a situation where I can download a PDF file from the Web or print to PDF, then, the first time I try to open the file, Preview opens briefly, then quits. The problem is that, once I try to open a particular file, the attributes are modified, so that the next time it opens normally. If I can add the right attributes to a file so that it demonstrates the problem, I can then submit the file to Apple so that maybe they can fix the problem.

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.

Command to Apply Extended Attributes?

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