print STDERR "saving block $writeCounter, \@ docID $docID "; system("date"); my $postingList = ''; my $posting = ''; my $output = ''; my $savename = "/indexes/1_indexBlock_$writeCounter"; print STDERR "saving $savename\n"; open my $save, ">.$savename" or die "can't open save $!\n"; flock($save, 2) or die "can't lock save $!\n"; print STDERR "$savename is open\n"; foreach my $x (sort (keys %inMemIndex)) { $postingList = $inMemIndex{$x}; $posting = "$x $inMemIndex{$x}\n"; $output .= $posting; } print $save $output or die "can't write to save $!\n"; $output = ''; %inMemIndex = (); flock($save, 8); close $save or die "can't close save $!\n"; system("./logMergeManager.pl $writeCounter &"); $writeCounter++; $totalWordSize = 0;