Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is there any risk associated in creating your own custom extended file attributes? For instance:

  1. should I be worried about naming collisions?
  2. is there any file instability or increased risk of data loss associated with adding extended attributes?
  3. is there anything else I should be concerned about that I'm not thinking of?

Extended attributes could be very useful to me for keeping track of file metadata that doesn't have any where else to be kept, and which I would like to keep about my important files with my important files. But I'd like to know what possible downsides there are before I start adding them to my files.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

So far the only risk I've found is that some applications will overwrite the custom extended attributes. TextEdit is one such example. It will remove the attribute and add a quarantined attribute in its place, which will cause the Finder to give you a warning (that it was downloaded from the internet) when you open it.

So if you don't want to lose the metadata you've added to your custom attributes, don't open in unsafe applications like TextEdit. TextMate and SublimeText 2 and vim don't damage your data, however.

(And as for name collisions, just follow the reverse DNS naming that Java uses. For example 'com.yourdomain.yourcustomname'.)

share|improve this answer
    
I've seen TextEdit remove xattrs, but not add quarrantine xattrs; what circumstances have you seen this? –  Gordon Davisson Mar 16 '13 at 19:23
    
Just opening a file from TextEdit, editing, and saving. I don't know if it's relevent, but the file was an empty file that I created with touch filename, and that I added an attribute to with xattr -w attribute "some text here". –  iconoclast Mar 16 '13 at 20:55
    
Since no one else is answering, I'll go ahead and accept my own answer, but I'll gladly switch to an answer that is better than mine (and is substantially new). –  iconoclast Mar 19 '13 at 0:00
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.