You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use warnings;
  4. use constant FLOPPYSIZE => 1440 * 1024;
  5. while ( my $filename = shift ) {
  6. die "$filename is not a file\n" unless -f $filename;
  7. die "$filename is too large\n" unless ( -s $filename <= FLOPPYSIZE );
  8. truncate $filename, FLOPPYSIZE or die "Could not truncate: $!\n";
  9. }