Eliot,
I've moved to my new site:
http://www.cellwarp.com The script that you were talking about was in two verions:
Code:
#!/usr/bin/perl
#
# +------------------------------------+
# | Simple File Cleaner 1.0 (Freeware) |
# | by Pasha Golovko |
# | cgi4free@find.virtualave.net |
# | http://find.virtualave.net/ |
# +------------------------------------+
#
$file = "software.db";
#
# +--------------------------------+ #
open(FILE, ">$file");
print FILE "";
close FILE;
print "Content-type: text/plain\n\n";
print "Done!";
and
Code:
#!/usr/bin/perl
#
# +------------------------------------+
# | Simple File Cleaner 1.1 (Freeware) |
# | by Pasha Golovko |
# | cgi4free@find.virtualave.net |
# | http://find.virtualave.net/ |
# +------------------------------------+
#
# +--------------------------------+ #
$file = "software.db";
$emailto = "cgi4free\@find.virtualave.net";
$emailfrom = "cgi4free\@find.virtualave.net";
$mailprog = "/usr/sbin/sendmail";
# +--------------------------------+ #
print "Content-type: text/plain\n\n";
open(DATABASE, "$file");
@entries = <DATABASE>;
open(MAIL,"|$mailprog -t");
print MAIL "To: $emailto\n";
print MAIL "From: $emailfrom\n";
print MAIL "Subject: The data from $file file has been deleted!\n\n";
print MAIL "$file\n\n";
print MAIL "\n\n";
foreach $line (@entries) {
print MAIL "$line\n";
}
close (MAIL);
close DATABASE;
open(FILE, ">$file");
print FILE "";
close FILE;
print "Done! You should receive $file in your $emailto mail account within 5 seconds or 6 hours (it depends on your mail server configuration).";
Neither of these scripts delete the file -- they clean the contents of it.
To delete the file using my web browser I would use this:
Code:
#!/usr/bin/perl
use CGI;
$in = new CGI;
$file = $in->param('file');
unlink ($file);
print "Content-type: text/plain\n\n";
print "$file was deleted!";
...and use it as:
http://www.server.com/cgi-bin/thisscript.cgi?file=/full/path/to/file.txt Am I right?
Best regards,
Pasha
------------------
www.cellwarp.com