mirror of
https://forge.murkfall.net/bluesaxman/squeegy.git
synced 2026-03-13 03:14:21 -06:00
a syntax correction and adding dynamic block sizes to zeroing
This commit is contained in:
7
wipe.pl
7
wipe.pl
@@ -167,8 +167,9 @@ sub wipethemdrives {
|
||||
seek($longdiskw,0,2);
|
||||
my $totalBytes = tell($longdiskw);
|
||||
seek($longdiskw,0,0);
|
||||
for (0..($totalBytes/4096 - 1)) {
|
||||
print $longdiskw "\0"x4096;
|
||||
my $blockSize = $totalBytes / 4096;
|
||||
for (0..($totalBytes/$blockSize - 1)) {
|
||||
print $longdiskw "\0"x$blockSize;
|
||||
if ( !($_ % 4) ) {
|
||||
system("hdparm -F ".$disks->{$diskid}{path}." 1>/dev/null 2>/dev/null");
|
||||
}
|
||||
@@ -178,7 +179,7 @@ sub wipethemdrives {
|
||||
"Zeroing ".$disks->{$diskid}{path},
|
||||
"."x(tell($longdiskw)/$totalBytes*($spacer+11)),
|
||||
(tell($longdiskw)/$totalBytes)*100 ,
|
||||
"ETA: ".$diskTimes[7].", )".$diskTimes[2].":".$diskTimes[1].":".$diskTimes[0];
|
||||
"ETA: ".$diskTimes[7].", ".$diskTimes[2].":".$diskTimes[1].":".$diskTimes[0]);
|
||||
}
|
||||
}
|
||||
my $leftover = $totalBytes - tell($longdiskw);
|
||||
|
||||
Reference in New Issue
Block a user