[Top] [All Lists]

Re: getfattr and setfattr

To: Eric Chen <echen@xxxxxxxxxxx>
Subject: Re: getfattr and setfattr
From: Stephen Lord <lord@xxxxxxx>
Date: 12 Feb 2003 21:26:47 -0600
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <NFBBIGILIDAABCBKKGMLOEDCCCAA.echen@ateonix.com>
References: <NFBBIGILIDAABCBKKGMLOEDCCCAA.echen@ateonix.com>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Wed, 2003-02-12 at 20:50, Eric Chen wrote:
> Hello SGI XFS development team member,
> I wanted to be able to integrate file copying with preserving extended
> attributes when copying to/from an XFS filesystem. I looked up different
> resources and tried out copying over the network in different ways, such as
> rcp, rsync, scp, smbfs, nfs. However, none of them support extended
> attributes, and extended attributes are lost when the file is copied over to
> the destination.
> I came across 'getfattr' and 'setfattr' and those 2 commands seem to
> preserve the EA if I first
> 'getfattr -Rd * > save_attr'
> then copy the files over
> then 'setfattr --restore=save_attr'
> This *seems* to work fine, but since you were listed as the author in the
> man pages, I thought you might know more about this. Ideally, I want to
> integrate file copying and preserving extended attributes, so I am
> attempting to modify the source code so that will be handled. I was hoping
> you could give me some more information, such as where I can find the code
> for 'getfattr' and 'setfattr' so I could take a look at it and get some idea
> from that.  I'm not really sure where to get started, so if you have any
> suggestions or references to resources that might help me on my way, I would
> be very grateful.
> Thanks,
> Eric

I think xfsdump/xfsrestore is the only pre-existing mechanism which
will preserve them. The cp command on Irix has been extended to copy
attributes if the -a option is specified. However, that code is not
something we can distribute, Irix cp almost certainly originated in
an AT&T code base, plus the attribute calls are different
between irix and linux.


<Prev in Thread] Current Thread [Next in Thread>