Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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?


Comment on Re^2: Copy preserving attributes
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://804546]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-10-02 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (67 votes), past polls