Update 'wipe.pl'

Added conditional to limit IO to terminal for progress output.
This commit is contained in:
bluesaxman 2019-11-04 12:06:51 -07:00
parent 69b9947f58
commit 3110fcd761

View File

@ -5,6 +5,8 @@ use Digest::MD5 "md5_base64";
use POSIX;
use v5.10;
$| = 0; #turn off IO buffering
# set CONFIRMATION_PHRASE to anything falsy (like zero) if you are a fast and
# loose badass and you don't need no stinkin' safety net.
use constant CONFIRMATION_PHRASE => "YES";
@ -150,7 +152,9 @@ sub wipethemdrives {
seek($longdiskw,0,0);
until (eof $longdiskw) {
print $longdiskw "\0";
printf(" %5.5s%%\r\r\r\r\r\r\r", sprintf("%.2f", (tell($longdiskw)/$totalBytes)) );
if ( !(tell($lingdiskw) % ($totoalBytes / 1000) ) {
printf(" %5.5s%%\r\r\r\r\r\r\r", sprintf("%.2f", (tell($longdiskw)/$totalBytes)) );
}
}
}
}