prev | index | [back] | next     a /usr/bin/perl script text executable     [image by itself: disk-sizes.pl]
[next]
#!/usr/bin/perl
# Purpose: Calculates disk sizes as defined by IDEMA.

# http://www.idema.org/_smartsite/modules/local/data_file/show_file.php?cmd=download&data_file_id=1066
#
#   The LBA count shall be calculated using the following formula:
#   LBA count = (97696368) + (1953504 * (Desired Capacity in Gbytes - 50.0))

sub lba { 97696368 + (1953504 * ($_[0] - 50.0)); }

@s = @ARGV or @s = (1_000, 1_500, 2_000, 2_500, 3_000);
for $gb (@s) {
  $lba = lba($gb);
  $_ = $lba * 512;
  print "$gb = $lba blocks = $_";
  while ($_ > 400) {
    $_ = $_ / 1024;
    printf "  %.3f", $_;
  }
  print "\n";
}


prev | index | [back] | next     a /usr/bin/perl script text executable
33 of 41:  disk-sizes.pl  18-Jan-2010 02:02  1.00K