Browse Source

Quick utility to pad floppy disk images for vmware/qemu

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
cddf8df8d4
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      src/util/dskpad.pl

+ 12
- 0
src/util/dskpad.pl View File

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

Loading…
Cancel
Save