iustin / pyxattr

A python module for accessing filesystem Extended Attributes
https://pyxattr.k1024.org/
GNU Lesser General Public License v2.1
30 stars 15 forks source link

Is there batch operations? #39

Closed 4l1fe closed 1 year ago

4l1fe commented 1 year ago

I see that cli util xattr can process many files like xattr -p user.attr file1 file2 ....

I'm not sure that it's a real batch operation in terms of internally one sys call for all the files, more likely one sys call per file.

Should i simply iterate files on my own and list, get, set, delete them one by one explicitly or the library supports it?

iustin commented 1 year ago

I'm not sure that it's a real batch operation in terms of internally one sys call for all the files, more likely one sys call per file.

The syscall interface is per file, indeed.

Should i simply iterate files on my own and list, get, set, delete them one by one explicitly or the library supports it?

The former - iterate over the list. The library doesn't offer a batch mode since that would be a meta-API on top of what the C library/syscall offers.