in reply to Re^2: Secure delete ie shred a file
in thread Secure delete ie shred a file
Would something like the following be at all secure? I imagine it might keep amateurs out, but not real spies.
sub srm {
my $filename = shift;
my $filesize = -s "$filename";
open FH, ">$filename";
binmode FH;
for (my $c = 0; $c < $filesize; $c++) {
print FH '9'; # it's more interesting than 0
}
print "Erased $filesize bytes!\n";
close FH;
unlink $filename;
}