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

Re: Unlink works in windows, not in Linux?

by rovf (Priest)
on Dec 12, 2012 at 10:00 UTC ( #1008474=note: print w/replies, xml ) Need Help??


in reply to Unlink works in windows, not in Linux?

Honestly, I don't think that the file is not deleted, but you still don't the error message. I suggest you replace

unlink $file or die "\nCould not delete the backup $file: $!";
by
print FILE "Now going to delete $file\n"; if(unlink $file) { print FILE "$file has been removed (says 'unlink')\n"; if(-e $file) { print FILE "Surprise, surprise! $file is still here\n"; } } else { print FILE "'unlink' says: $!\n"; if(-e $file) { print FILE "And indeed, we still see $file\n"; } else { print FILE "A miracle occured! $file is gone!\n"; } }

-- 
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://1008474]
help
Chatterbox?
[stevieb]: failure! $current_taask does not exist. No further work pending. Go home
[erix]: Upward Mobility Day
[erix]: in 3D (Walsingham)
erix likes the Toe-Rays
[marinersk]: stevieb LOL yep.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2017-05-25 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?