Pārlūkot izejas kodu

Quick utility to pad floppy disk images for vmware/qemu

tags/v0.9.3
Michael Brown 18 gadus atpakaļ
vecāks
revīzija
cddf8df8d4
1 mainītis faili ar 12 papildinājumiem un 0 dzēšanām
  1. 12
    0
      src/util/dskpad.pl

+ 12
- 0
src/util/dskpad.pl Parādīt failu

@@ -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
+}

Notiek ielāde…
Atcelt
Saglabāt