On Fri, Dec 01, 2023 at 03:38:10PM +0200, Adrian Sevcenco wrote:
> On 01.12.2023 15:04, Guilherme Amadio wrote:
> > Hi Adrian,
> Hi!
>
> > On Fri, Dec 01, 2023 at 02:57:25PM +0200, Adrian Sevcenco wrote:
> >> On 01.12.2023 14:40, Guilherme Amadio wrote:
> >>> Dear Adrian,
> >> Hi!
> >>
> >>> On Fri, Dec 01, 2023 at 02:34:34PM +0200, Adrian Sevcenco wrote:
> >>>> Hi! What would be standard way to set xattrs in a xrdcp uri? (through opaque params)
> >>>
> >>> Attributes are set using xrdfs instead of xrdcp. Please take a
> >>> look at the manual page for xrdfs. Here's the syntax:
> >>>
> >>> xrdfd root://<host> xattr <path> <code> <params>
> >>> Operation on extended attributes. Codes:
> >>>
> >>> set <attr> Set extended attribute; <attr> is
> >>> string of form name=value
> >>> get <name> Get extended attribute
> >>> del <name> Delete extended attribute
> >>> list List extended attributes
> >>>
> >>> I hope this answers your question.
> >> well, yes and no :) yes i was aware of xrdfs possibility, i was hoping that
> >> is doable through copy process by setting some cgi in the uri ...
> >
> > I don't think there's a way to set xattrs by adding cgi to the
> > destination URL, but what you can do is to set the attributes locally
> > and use the --xattrs option from xrdcp to preserve them when copying the
> > file over. Is that good enough?
> yes, this is perfect!! (especially that is already available :) )
>
> now, the problem is if that is available for python bindings :)
> I see that there is PreserveXAttrs for env, would it work to do:
> xrd_client.EnvPutInt('PreserveXAttrs', 1) ?
In Python you have also get_xattr/set_xattr/list_xattr which you can use.
I think if you are creating a file with the bindings, you can also just
set the attributes directly on the destination. The online documentation
is unfortunately out of date, I will take care of that later. The
set_xattr function takes a list of tuples, like:
from pyxrootd import client
f = client.File()
f.open('root://...', ...)
f.set_xattr(attrs=[ ( 'attr1', 'value1' ), ( 'attr2', 'value2' )])
Not the most intuitive way of doing things, but should work for you too.
Cheers,
-Guilherme
########################################################################
Use REPLY-ALL to reply to list
To unsubscribe from the XROOTD-L list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-L&A=1
|