Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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 contemplating the Monastery: (5)
As of 2015-08-01 02:14 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (285 votes), past polls