
sleuth
Enthusiast
Dec 12, 2000, 2:50 PM
Post #1 of 1
(3240 views)
|
|
How Do I delete A File?
|
Can't Post
|
|
use unlink. unlink "file.txt"; If the file is located in another directory than the one your script is executing from, then simply specify the full path before the file's name. unlink "/path/to/file.txt"; To check and see if this code fails, use this unlink "file.txt" or die "Couldn't Delete File because: $!"; Instead of die you can use print to actually print the message to the screen, when you execute your code through a browser this will help more than die, but the script will continue executing. Sleuth
|