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

Re^2: How to copy a file in a perl variable to a directory

by rovf (Priest)
on Jul 20, 2012 at 15:58 UTC ( #982858=note: print w/replies, xml ) Need Help??


in reply to Re: How to copy a file in a perl variable to a directory
in thread How to copy a file in a perl variable to a directory

While it is certainly advisable to output $!, it is not always clear whether the reported error relates to the source- or the destination file. This is particularily true in case the code is supposed to run on Windows, where I found that many kinds of access problems lead to the same error string.

I would therefore also do some basic checks before calling copy, at least: read permission on the source file, write permission for the destination directory.

-- 
Ronald Fischer <ynnor@mm.st>

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982858]
help
Chatterbox?
[davido]: The code seems pretty sane, and relatively foolproof. I guess I can answer my own question; move() should work across filesystems so long as they're mounted, rw, and not filled up.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2016-12-10 03:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (159 votes). Check out past polls.