Any risks in creating custom OS X extended attributes

hfs+

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.

Best Answer

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'.)