Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: how to find out if move succeeds?

by Roy Johnson (Monsignor)
on Feb 25, 2009 at 17:48 UTC ( #746330=note: print w/replies, xml ) Need Help??


in reply to how to find out if move succeeds?

You already test the result of move, you just don't change what your log writes. You also duplicated code in both branches of the if. I think it ought to go something like this:
if (not -e $newlocationlocation) { my $perm = 775; mkdir ($newlocation,$perm) or &on_err("Error making Directory\n"); } if (move ($oldlocation,$newlocation)) { print LOGFILE "$theTime,moved,$oldlocation,$folder\n"; } else { warn "Failed to move to folder"; print LOGFILE "$theTime,failed to move,$oldlocation,$folder\n"; }

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2016-12-06 03:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (99 votes). Check out past polls.