Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
There's more than one way to do things
 
PerlMonks  

Re^2: Why isn't there a "copy" function?

by mce (Curate)
on Sep 10, 2004 at 07:11 UTC ( #389983=note: print w/ replies, xml ) Need Help??


in reply to Re: Why isn't there a "copy" function?
in thread Why isn't there a "copy" function?

Good point,
On unix, File::Copy needs to be called when moving a file, but on Windows Win32::FileCopy is more reliable.
copy-ing a file works best when the direct OS API's are called. (has to do with file permissions etc... ).


---------------------------
Dr. Mark Ceulemans
Senior Consultant
BMC, Belgium


Comment on Re^2: Why isn't there a "copy" function?
Re^3: Why isn't there a "copy" function?
by Anonymous Monk on Sep 10, 2004 at 09:15 UTC
    On unix, File::Copy needs to be called when moving a file,

    If you like to be surprised or use non-flexible API, you'd use File::Copy. If you're smart, you'd use system cp. Things that are easy with system cp and awkward with File::Copy include:

        cp file1 file2 dir
        cp -r dir1 dir2
        cp -p file1 file2
        cp exe1 exe2
    
    Not to mention that I can stick an 'r' or an 's' in front of it, and copy from one machine to another.
      Unfortunately system(qw(cp ...)) is not portable. That's why there is File::NCopy, which I would like to see in the perl core instead of File::Copy.
        Mark Ceulemans wrote: On unix, File::Copy needs to be called, and you say that 'system cp' isn't portable. Could you point out a Unix system that doesn't have cp?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-04-18 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls