Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2017-12-12 07:51 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (327 votes). Check out past polls.