2

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.

1 Answer 1

3

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

3
  • I've seen TextEdit remove xattrs, but not add quarrantine xattrs; what circumstances have you seen this? Mar 16, 2013 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, 2013 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, 2013 at 0:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .