# HG changeset patch # User Masataka Kohagura # Date 1391255046 -32400 # Node ID d7f1710e0070f66ec201dc5aa6ae3d919d8f0b25 # Parent f57779f1d93a46b23e13e91f0ecddb3d72418959 add bigfile.pl diff -r f57779f1d93a -r d7f1710e0070 example/regex_mas/bigfile.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/regex_mas/bigfile.pl Sat Feb 01 20:44:06 2014 +0900 @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +my $loop_counter = 0; +my $exec_result = 0; + +my $original_filename = $ARGV[0]; +my $make_filename = $ARGV[1]; +my $make_filesize = $ARGV[2] * 1024 * 1024 * 1024; + +if (@ARGV != 3) { + print("Usage: ./bigfile.pl [original filename] [make filename] [make filesilze(GB)]\n"); + exit(0); +} + +my $original_filesize = -s $original_filename; +my $loop_num = $make_filesize / $original_filesize; + + +print "original file name : $original_filename\n"; +print "original file size : $original_filesize\n"; +print "make file name : $make_filename\n"; +print "make file size : $make_filesize\n"; +print "make file size(GB) : $make_filesize\n"; + +while ($loop_counter < $loop_num) { + $exec_result = `cat $original_filename >> $make_filename`; + $loop_counter++; +} +