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

Re: Deleting a File in Windows

by ccn (Vicar)
on May 05, 2009 at 16:17 UTC ( #761979=note: print w/replies, xml ) Need Help??

in reply to Deleting a File in Windows

  • Use forward slashes not back slashes in filenames
  • Check return codes to be sure that system call was successful
unlink("C:/Users/deadpickle/file/to/delete") or die "Can't delete a fi +le\n";

Replies are listed 'Best First'.
Re^2: Deleting a File in Windows
by Anonymous Monk on May 05, 2009 at 19:59 UTC
    • deadpickle's path appears well formed, meaning he knows how to escape slashes, so forward slashes aren't needed.
    • Usually you want to know why unlink failed (and on what line)
    my $filename = qw[ C:\Users\deadpickle\Desktop\UAS\GRRUVI_1.60\panel\U +AS01 ]; unlink $filename or die "Couldn't unlink($filename) : ($!)($^E)"; __END__ Couldn't unlink(C:\Users\deadpickle\Desktop\UAS\GRRUVI_1.60\panel\UAS0 +1) : (No such file or directory)(The system cannot find the path spec +ified) at - line 2.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://761979]
[choroba]: I don't even remember the beginning
[choroba]: someone told me to use perl instead of sed for something, and several years later, I'm developing a huge Tk application
[Discipulus]: choroba started in primary school to get some advantage in the future..
[choroba]: nono, I programmed in Basic at the primary school, on my Commodore 116/16
[Discipulus]: ;=)
[choroba]: then learned some assebly on the same machine, then moved to my father's PC (XT with a Hercules card), used Turbo Pascal a lot
[choroba]: I started with *nix at the University, we had some Sparcs and Linux machines
[choroba]: that was around 1994 or 95

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2018-06-22 09:37 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (123 votes). Check out past polls.