diff options
author | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-06-28 10:15:24 +0100 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-06-28 10:15:24 +0100 |
commit | e06d0bbf2a7edea146a4041a3c85d77d11d34e48 (patch) | |
tree | 8d4fcff7ab3705384a15126ad3b68db5686e0f8b /util/shortf.pl | |
download | lzo-e06d0bbf2a7edea146a4041a3c85d77d11d34e48.tar.gz |
Tarball conversion
Diffstat (limited to 'util/shortf.pl')
-rw-r--r-- | util/shortf.pl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/util/shortf.pl b/util/shortf.pl new file mode 100644 index 0000000..380d3eb --- /dev/null +++ b/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-2011 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); |