downer has asked for the wisdom of the Perl Monks concerning the following question:
when $writeCounter gets to 1342, the program dies on writing with the error: "can't write to save Inappropriate ioctl for device" i'm sorry i can't really give a condensed version of the code since this is part of a very large program. i added the flocks just to ensure that nothing is trying to open the file at the same time, its possible that i'm not using these correctly, though i was having this error before i included these. can anyone see any obvious flaws?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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inappropriate ioctl for device
by ikegami (Patriarch) on Oct 29, 2007 at 14:41 UTC | |
by downer (Monk) on Oct 29, 2007 at 14:55 UTC | |
by ikegami (Patriarch) on Oct 29, 2007 at 14:57 UTC | |
|
Re: Inappropriate ioctl for device
by Fletch (Bishop) on Oct 29, 2007 at 14:27 UTC |