Blame thirdparty/lzo/2.03/util/shortf.pl
|
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 short 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 |
$c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
kusano |
7d535a |
$c = "\x00\x01\x02";
|
|
kusano |
7d535a |
$c = "\x00";
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
$x = $c x 1024;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
for $i (0 .. 50) {
|
|
kusano |
7d535a |
$name = sprintf("f%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);
|
|
kusano |
7d535a |
close(OUTFILE);
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
exit(0);
|