Re: question about forked processes writing to the same file



simon.chao@xxxxxxxxx wrote in
news:1129994532.138751.160740@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

> Gunnar Hjalmarsson wrote:

>> I can add that I'm using the above method in a widely used Perl
>> program (run on various platforms), without any problems having been
>> reported. However, I do use flock() to set an exclusive lock before
>> printing to the file. Can't tell if locking is necessary.

....

> hello Gunnar, could you please post a snippet of code illustrating how
> you would use flock() in my above example?

So far,I do not see any code posted by you.

Maybe, you should read the documentation, and come up with a short
script illustrating your problem, and we can comment on it:

perldoc -q lock

perldoc -f flock

Sinan
--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

.



Relevant Pages