A
Anders F
Is there a Perl subroutine for deleting files?
My problem is that I have a perl script to backup files.
First it copies all files I want to backup to a temporary directory,
then it zips the temporary directory and puts the result in a
permanent backup directory which I can copy to some external
device.
After zipping, I want to delete the temporary directory and I can
do this with system( "del ..."); and system( "rmdir ...");
My problem is that del prints the name of every file it deletes
filling the whole Command Promt buffer. Besides being irritating,
this means that if something goes wrong before I delete the files,
I can not see it.
So I want some alternate way to delete files. If possible deleting
a directory with all files and subdirectories in one command,
else it should not bee too difficult to make a recursive subroutine
and delete the files one by one.
(I have Windows XP SP2. The "del" command has no switch to supress
printout.)
Thanks for any answer
Anders
My problem is that I have a perl script to backup files.
First it copies all files I want to backup to a temporary directory,
then it zips the temporary directory and puts the result in a
permanent backup directory which I can copy to some external
device.
After zipping, I want to delete the temporary directory and I can
do this with system( "del ..."); and system( "rmdir ...");
My problem is that del prints the name of every file it deletes
filling the whole Command Promt buffer. Besides being irritating,
this means that if something goes wrong before I delete the files,
I can not see it.
So I want some alternate way to delete files. If possible deleting
a directory with all files and subdirectories in one command,
else it should not bee too difficult to make a recursive subroutine
and delete the files one by one.
(I have Windows XP SP2. The "del" command has no switch to supress
printout.)
Thanks for any answer
Anders