You can now really edit extended attributes with xattred

To celebrate the New Year, I thought that it was time to turn my extended attribute (xattr) editor, xattred, into a tool which can actually edit xattrs usefully at last.

In the first wave of changes, which resulted in the unreleased version 0.5a1, I have completely rewritten the xattr handling code to use a couple of custom classes. This has enabled the Table View to work much better now, so I have removed the general listing of xattrs from the lower text view. This gives the app a much cleaner interface, and prepares the way for further features.

I also worked out how to decode a high proportion of xattrs which are stored as binary property lists. These are much like the .plist property list files used to store app preferences and more, but have to be unravelled from their binary formats. With over a hundred different xattrs containing these, trying to build a large table of their structures was clearly not a good way ahead. Some xattrs can use more than one structure too.

Over the New Year, I have been able to take this further, to the next alpha version, 0.6a1, which at last adds support for cut, copy, and paste. There are two slight snags with this: first is that, for the moment, there is no undo. If you have to work on important files or folders, then please use copies and not originals (which is wisest when working with xattrs at the best of times).

The other dafter issue is that, although cut, copy, and paste now work fine from buttons, they are not yet available from the Edit menu, I’m afraid. The very few documents which discuss implementing these features for custom data (as xattrs have to be) claim that they ‘just work’, but my menu commands never become enabled, despite all the code being present and ready to run. So I have instead tied these features to buttons for the time being.


Now, xattred can:

  • Add a genuine quarantine flag to any item; this makes it ideal for anyone who wants to check that their signed app will pass Gatekeeper’s full checks.
  • List and show the contents of all xattrs attached to a file or folder. Contents are shown as hexadecimal, UTF or ASCII text, and as a decoded binary property list, as appropriate.
  • Cut, Copy, and Paste xattrs from one item to another. This works for any xattr with any type of content, including arbitrary binary content.
  • Save to text files the contents of individual xattrs.

I am not aware of any other GUI tool which offers these facilities, and copying xattrs between files at the command line is not an easy task.

My next two tasks are to implement Undo (and hopefully enable the Edit menu commands), and to provide a xattred editor which lets you create new xattrs, and edit the content of existing ones.

This new alpha release, which runs on Sierra and High Sierra, is here: xattred06a1
and in Downloads above.