瀏覽代碼

Quick utility to pad floppy disk images for vmware/qemu

tags/v0.9.3
Michael Brown 18 年之前
父節點
當前提交
cddf8df8d4
共有 1 個檔案被更改,包括 12 行新增0 行删除
  1. 12
    0
      src/util/dskpad.pl

+ 12
- 0
src/util/dskpad.pl 查看文件

@@ -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…
取消
儲存