Hi,
I'm attempting to get a perl script to work on Win98. Unfortunately, when I make calls to the system, it bombs out. Are there utilities that will erase files available without calling the command prompt? Any ideas would be much appriciated.
for descriptions of [tt]unlink()[/tt] and other file functions. Your distribtion should include equivalent documentation.
Yours,
fish
"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilkes
Although concerned with directories not files, you can reap a whole directory structure (include all files and subdirectories) with rmtree() and create all the directories in a single path with mkpath(). Very useful app.
#here's the code I'm converting to win98 from XP:
use warnings;
use strict;
my $temp;
my @files = glob("o:\\internet\\*.txt"
for $_ (@files){
print "Email: $_ \n";
# call DOS sendmail app (I'm sure I can pipe to the app
# instead)
$temp = system("c:/sendmail/sendmail -t -messagefile=$_"
if ($temp==0){
# delete the file in question
system("del $_"
}
}
# delete these unused files from this dir, cannot remove the
# dir b/c of other files stored here.
system("del o:\\internet\\*.wrk"
system("del o:\\internet\\*.tmp"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.