moksha
moksha

Reputation: 33

Preserving xattr on download

I'm trying to store some metadata in a .txt file using xattr on a website, then download it. If I use PHP's xattr_set on the temporary file when running the website locally, both xattr_list in PHP and python-xattr on the command line show me the attributes I set. However, when I download the file using readfile, the attributes no longer show up. Is there any way to preserve these attributes on download?

Upvotes: 3

Views: 366

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799062

Not directly. HTTP has no way of specifying filesystem extended attributes, so you will need to package them in an appropriate archive format that allows specifying them in the metadata, e.g. GNU tar with --xattrs.

Upvotes: 3

Related Questions