How to maintain extended attributes with file transfer

I am modifying file attributes, however I am modifying them for distribution to non-technical people.

Is there anyway I can write attributes to a file and they actually persist when I move them from location to location? I am transferring them from a python web server on my mac to other people with macs but the attributes are all removed.

e.g. com.apple.launchservices.openWith

I am trying to get a file.command to open with text editor by default when I send it. (as a test of persistence)


Apple stores metadata in the file system and not the file, so the easy path would be to include a file system if you need everything to be perfect.

This is the genesis of the need for disk images and installer packages so that you can exert control over the file once it gets written to the file system if using web browsers or other transfer methods fail to set attributes.

Creating a disk image (dmg file) can be a good place to start with this and based on how technical you wish to get, can be quite fancy.

  • https://stackoverflow.com/questions/367751/creating-a-dmg