summaryrefslogtreecommitdiff
path: root/lzo/util/shortf.pl
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-04-16 19:21:14 +0200
committerArne Schwabe <arne@rfc2549.org>2012-04-16 19:21:14 +0200
commit3e4d8f433239c40311037616b1b8833a06651ae0 (patch)
tree98ab7fce0d011d34677b0beb762d389cb5c39199 /lzo/util/shortf.pl
Initial import
Diffstat (limited to 'lzo/util/shortf.pl')
-rw-r--r--lzo/util/shortf.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/lzo/util/shortf.pl b/lzo/util/shortf.pl
new file mode 100644
index 00000000..0bee2e06
--- /dev/null
+++ b/lzo/util/shortf.pl
@@ -0,0 +1,31 @@
+#! /usr/bin/perl
+##
+## vi:ts=4
+##
+##---------------------------------------------------------------------------##
+##
+## Author:
+## Markus F.X.J. Oberhumer <markus@oberhumer.com>
+##
+## Description:
+## Create short files for compression test
+##
+## Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer
+##
+##---------------------------------------------------------------------------##
+
+$c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+$c = "\x00\x01\x02";
+$c = "\x00";
+
+$x = $c x 1024;
+
+for $i (0 .. 50) {
+ $name = sprintf("f%04d.dat",$i);
+ open(OUTFILE,">$name") || die "$0: cannot open '$name': $!";
+ binmode(OUTFILE);
+ print OUTFILE substr($x,0,$i);
+ close(OUTFILE);
+}
+
+exit(0);