summaryrefslogtreecommitdiff
path: root/app/lzo/util/shortf.pl
blob: 380d3ebe04d27e02cabca3cc90dcc78d12c358c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);