tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cp/mv and extended attributes preservation



Emmanuel Dreyfus wrote:
> On Tue, Jul 26, 2011 at 12:26:30PM +0000, Emmanuel Dreyfus wrote:
>
> > Currently, our cp(1) will never preserve extended attributes, and mv(1)
> > will only do so across the same filesystem (that is, when it can use
> > rename(2)). While I found no specification that it should be done, it
> > seems Linux and Darwin do that. 
> > 
> > Any objection to modify cp(1) and mv(1) to preserve extended attributes?
> 
> Attached is a patch that does it. I am concerned that with multi-file
> cp or mv, it adds a system call for each copied file, even if it has
> no extended attributes. I suspect the overhead is negligible compared 
> to time spent in I/O, but if someone sees a better way of doing it...

If you do this, can a single copy of copy_file_xattr() be used, and
referenced from the other program?

Cheers,
Simon.


Home | Main Index | Thread Index | Old Index