kusano 7d535a
#! /usr/bin/perl
kusano 7d535a
##
kusano 7d535a
## vi:ts=4
kusano 7d535a
##
kusano 7d535a
##---------------------------------------------------------------------------##
kusano 7d535a
##
kusano 7d535a
##  Author:
kusano 7d535a
##      Markus F.X.J. Oberhumer         <markus@oberhumer.com></markus@oberhumer.com>
kusano 7d535a
##
kusano 7d535a
##  Description:
kusano 7d535a
##      Create uncompressible files for compression test
kusano 7d535a
##
kusano 7d535a
##  Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
##
kusano 7d535a
##---------------------------------------------------------------------------##
kusano 7d535a
kusano 7d535a
$x = ' ' x 65536;
kusano 7d535a
$i = 0;
kusano 7d535a
while ($i < 65536) {
kusano 7d535a
    substr($x,$i,1) = pack('C',rand(256));
kusano 7d535a
    $i++;
kusano 7d535a
}
kusano 7d535a
kusano 7d535a
for $i (1,2,4,8,16,32,64) {
kusano 7d535a
    $name = sprintf("u%04d.dat",$i);
kusano 7d535a
    open(OUTFILE,">$name") || die "$0: cannot open '$name': $!";
kusano 7d535a
    binmode(OUTFILE);
kusano 7d535a
    print OUTFILE substr($x,0,$i*1024);
kusano 7d535a
    close(OUTFILE);
kusano 7d535a
}
kusano 7d535a
kusano 7d535a
exit(0);