home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lzo100.zip / lzo-1.00 / util / shortf.pl < prev    next >
Perl Script  |  1996-10-22  |  702b  |  32 lines

  1. #! /usr/bin/perl
  2. ##
  3. ## vi:ts=4
  4. ##
  5. ##---------------------------------------------------------------------------##
  6. ##
  7. ##  Author:
  8. ##      Markus F.X.J. Oberhumer         markus.oberhumer@jk.uni-linz.ac.at
  9. ##
  10. ##  Description:
  11. ##      Create short files for compression test
  12. ##
  13. ##  Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
  14. ##
  15. ##---------------------------------------------------------------------------##
  16.  
  17. $c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  18. $c = "\x00\x01\x02";
  19. $c = "\x00";
  20.  
  21. $x = $c x 1024;
  22.  
  23. for $i (0 .. 50) {
  24.     $name = sprintf("f%04d.fil",$i);
  25.     open(OUTFILE,">$name") || die "$0: cannot open '$name': $!";
  26.     binmode(OUTFILE);
  27.     print OUTFILE substr($x,0,$i);
  28.     close(OUTFILE);
  29. }
  30.  
  31. exit(0);
  32.