Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: copy, cp or syscopy of File::Copy?

by duelafn (Priest)
on Feb 24, 2013 at 13:34 UTC ( #1020400=note: print w/ replies, xml ) Need Help??

in reply to copy, cp or syscopy of File::Copy?

There is a difference between copy and cp. From File::Copy:

... as of version 2.15, "cp" will preserve the source file's permission bits like the shell utility cp(1) would do, while "copy" uses the default permissions for the target file (which may depend on the process' "umask", file ownership, inherited ACLs, etc.). ...

In summary:
copy: copy file with default permissions
cp: copy file preserving permissions
syscopy: not actually sure what it does (doesn't preserve owner or permissions in Linux)

Being a Linux user, I'm not actually sure what filesystem oddness syscopy is trying to address. It seems that in Linux, "cp" is the best option. It may be that syscopy is best on other OSes (assuming what you really want is a true copy of all file properties).

Update: Fixed some descriptions after testing a bit.

Good Day,

Comment on Re: copy, cp or syscopy of File::Copy?
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2015-11-28 03:42 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (737 votes), past polls