Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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

by duelafn (Vicar)
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,

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-05-25 11:42 GMT
Find Nodes?
    Voting Booth?