#!\usr\local\bin\perl # GenFiles.pl -- Creates files of a certain size for testing purposes $ver = "v1.0"; # 07-Mar-1998 JPV #################################################################################### ($0 =~ s/^.*\\|\..*$//ig); # remove stuff up to the last "\" and after the "." $Greeting = ("$0 $ver Copyright 1998 JP Vossen (http://www.netaxs.com/~vossenjp/)\n"); $Greeting .= (" Licensed under the GNU GENERAL PUBLIC LICENSE:\n"); $Greeting .= (" See http://www.gnu.org/copyleft/gpl.html for full text and details.\n"); # Version and copyright info ($0 =~ s/^.*\\|\..*$//ig); # remove stuff up to the last "\" and after the "." if (("@ARGV" =~ /\?$/) || (@ARGV > 0)) { #if wrong # of args, or a ? in args - die die ("\n$Greeting\n\n\tUsage: $0\n \tEdit script to change number/size of generated files.\n"); } #end of argument check if @files = ("025","050","075","100","125","150","175","200"); # The names and sizes (more or less) of files to output $bigline = "This line will be 1k (1024 bytes), more or less, minus 5 bytes for line numbers, tabs, and CRLF. "; while (length($bigline) < 1024) { $bigline .= "X"; # pad bigline out to 1k } #enf of while print ("\n$Greeting\n\nGenerating files:\n"); foreach $parm (@files) { open (OUTFILE, ">bf$parm.txt") || die "$0: error opening bf$parm.txt for output.\n\n"; print ("\tbf$parm.txt...\n"); for($x=1; $x <= $parm; $x++) { print OUTFILE ("$x\t$bigline\n"); } #end of for } # end of foreach