Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: What is the easiest way to copy one file to another?

by jwest (Friar)
on Oct 31, 2001 at 01:12 UTC ( #122202=note: print w/ replies, xml ) Need Help??


in reply to What is the easiest way to copy one file to another?

For a more fun, but less portable and unrecommended solution...

link($oldfile, $newfile); unlink($oldfile);

But you should really be using File::Copy as ar0n suggests.

Update: Which, of course, actually performs a rename and not a copy. So, it's doubly true that File::Copy should be used instead.

-><- -><- -><- -><- -><-
All things are Perfect
    To every last Flaw
    And bound in accord
         With Eris's Law
 - HBT; The Book of Advice, 1:7


Comment on Re: What is the easiest way to copy one file to another?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2014-12-28 10:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (180 votes), past polls