Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; my $random = '/dev/prandom'; my $zero = '/dev/zero'; my %files; $files{$_} = int(-s $_) foreach (@ARGV); open(RAND, "<", $random); open(ZERO, "<", $zero); foreach my $file (keys %files) { print "$file: $files{$file}\n"; foreach my $num (1..5) { open(FILE, ">", $file); foreach (0..($files{$file} / 1024 + 1)) { read(RAND, my $rand, 1024); print FILE $rand; } close(FILE); open(FILE, ">", $file); foreach (0..($files{$file} / 1024 + 1)) { read(ZERO, my $z, 1024); print FILE $z; } close(FILE); } unlink($file); } close(RAND); close(ZERO);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Does this script securely delete data?
by daxim (Curate) on Jul 14, 2007 at 04:22 UTC | |
|
Re: Does this script securely delete data?
by snopal (Pilgrim) on Jul 14, 2007 at 04:18 UTC | |
|
Re: Does this script securely delete data?
by roboticus (Chancellor) on Jul 14, 2007 at 04:22 UTC | |
by DrHyde (Prior) on Jul 16, 2007 at 09:36 UTC | |
|
Re: Does this script securely delete data?
by swampyankee (Parson) on Jul 16, 2007 at 03:40 UTC |