Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Following is a modification of the code from perlopentut which I assumed to be safe. A coworker informed me we got data corruption, at "someplace else" a partial mail was written. The logfiles reveal nothing unusual.
Does this create a race condition or do I have to look somewhere else for a possible explanation? Does IO::File, when used in this manner, use sysopen internally or not?use Fcntl qw(:DEFAULT :flock); use IO::File; # [...] my $mbox = new IO::File $cMailBoxFile, O_RDWR or logthis("could not op +en <$cMailBoxFile> for read/write: $!"; flock $mbox, LOCK_EX; logthis("opened and locked <$cMailBoxFile>");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 5.8, locking with IO::File and Fcntl
by jfroebe (Parson) on Mar 09, 2005 at 15:01 UTC |