Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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,
    Dean


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2014-08-20 07:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (107 votes), past polls