After this routine runs I do a ls -l on my directory and the following is printed out.my $increment = 1000000; #For this example $$config{blocksize} == 550 my $records = int($increment / $$config{blocksize}); my $bytecnt = $$config{blocksize} * $records; #After caluclations this prints out as 999900 print "bytecnt[$bytecnt]\n"; my $file = 0; open PARENT, $$self{data} or die "Cannot open [$$self{data}] for i +ncremental parsing\n"; while(1){ $file++; my $data = ""; if($file == 1){ read(PARENT, $data, $$config{startblock}); read(PARENT, $data, $bytecnt); open(FILE, ">tmp\\$$self{process}".sprintf("%02d", $file). +".dat") or die "Cannot open tmp\\$$self{process}".sprintf("%02d", $fi +le).".dat for incremental writing\n"; print FILE $data; close(FILE); next; } read(PARENT, $data, $bytecnt); open(FILE, ">tmp\\$$self{process}".sprintf("%02d", $file).".da +t") or die "Cannot open tmp\\$$self{process}".sprintf("%02d", $file). +".dat for incremental writing\n"; print FILE $data; close(FILE); if(eof(PARENT)){ last; } } close(PARENT); die;
There are more files in the ls, but I am putting the files that operate outside the behavior that I expect. My confusion is, if my blocksize is constant, and my file length is constant, then how is it possible to be printing variable file lengths? The only file that should be different in length is the last one...-rwxr-x---+ 1 999946 May 30 09:27 patient01.dat -rwxr-x---+ 1 1000463 May 30 09:27 patient02.dat -rwxr-x---+ 1 999940 May 30 09:27 patient03.dat -rwxr-x---+ 1 999944 May 30 09:27 patient04.dat -rwxr-x---+ 1 999931 May 30 09:27 patient05.dat -rwxr-x---+ 1 999945 May 30 09:27 patient06.dat -rwxr-x---+ 1 1000236 May 30 09:27 patient38.dat -rwxr-x---+ 1 1000122 May 30 09:27 patient39.dat -rwxr-x---+ 1 1000031 May 30 09:27 patient41.dat
In reply to Unexpected File Results by Grundle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |