diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-04-16 19:21:14 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-04-16 19:21:14 +0200 |
commit | 3e4d8f433239c40311037616b1b8833a06651ae0 (patch) | |
tree | 98ab7fce0d011d34677b0beb762d389cb5c39199 /lzo/util/uncompr.pl |
Initial import
Diffstat (limited to 'lzo/util/uncompr.pl')
-rw-r--r-- | lzo/util/uncompr.pl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lzo/util/uncompr.pl b/lzo/util/uncompr.pl new file mode 100644 index 00000000..86c52655 --- /dev/null +++ b/lzo/util/uncompr.pl @@ -0,0 +1,32 @@ +#! /usr/bin/perl +## +## vi:ts=4 +## +##---------------------------------------------------------------------------## +## +## Author: +## Markus F.X.J. Oberhumer <markus@oberhumer.com> +## +## Description: +## Create uncompressible files for compression test +## +## Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +## +##---------------------------------------------------------------------------## + +$x = ' ' x 65536; +$i = 0; +while ($i < 65536) { + substr($x,$i,1) = pack('C',rand(256)); + $i++; +} + +for $i (1,2,4,8,16,32,64) { + $name = sprintf("u%04d.dat",$i); + open(OUTFILE,">$name") || die "$0: cannot open '$name': $!"; + binmode(OUTFILE); + print OUTFILE substr($x,0,$i*1024); + close(OUTFILE); +} + +exit(0); |