in reply to File not responding after first append
You're liable to get further on this if you check errors, particularly the result of open(). By not checking, you're discarding potentially valuable clues. Try:
I suspect you don't have permission to write into tempevents/open(FILE, ">./tempevents/$i.dat") or die "./tempevents/$i.dat: $!";
Note also that you have a potentially file-corrupting race condition when you're appending a record (in the $auth==0 case). Between the time you open() the file and the time you flock() it, there's a window were a separate process can add a record, which you're positioned to overwrite. The solution is to seek to EOF once you've obtained the lock.
And are you sure you don't want a "\n" on the end of each record?
|
|---|