Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^2: Copy preserving attributes

by puterboy (Scribe)
on Nov 02, 2009 at 19:04 UTC ( #804546=note: print w/replies, xml ) Need Help??

in reply to Re: Copy preserving attributes
in thread Copy preserving attributes

any solution for extended attributes/ACLs? Or is that too system specific.

Also, how does the efficiency of a single cp system call compare to the code you would have to read and then set timestamp/ownership/permissions internally in perl?

Replies are listed 'Best First'.
Re^3: Copy preserving attributes
by JavaFan (Canon) on Nov 02, 2009 at 19:35 UTC
    Considering that the running time of the 'cp' is most likely to be bound by disk I/O, I wouldn't worry about the overhead of calling 'cp'.

    Specially if you have the need to take care of system specifics (like extended attributes/ACLs), I would prefer calling the systems 'cp' then doing it all yourself. Specially if you don't have access to all the environments the program is supposed to run in.

      I'd have to agree with JavaFan, especially considering those new-fangled attributes. One potential for optimization, if you're not renaming files: you could gather them up by destination directory, and copy multiple files within one command. Not the best solution for error reporting though.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://804546]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2018-03-24 12:46 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (298 votes). Check out past polls.