in reply to Re: Mysterious Disapperance of file contents
in thread Mysterious Disapperance of file contents
you're not supposed to open, and then lock your lock/semaphore file...
As someone unfamiliar with flock semantics, could you explain how your comments sits with the example given in the docs for flock:
use Fcntl ':flock'; # import LOCK_* constants sub lock { flock(MBOX,LOCK_EX); # and, in case someone appended # while we were waiting... seek(MBOX, 0, 2); } sub unlock { flock(MBOX,LOCK_UN); } open(MBOX, ">>/usr/spool/mail/$ENV{'USER'}") or die "Can't open mailbox: $!"; lock(); print MBOX $msg,"\n\n"; unlock();
and with flock taking a filehandle? Doesn't that mean I have to open it before I lock it?
I'm blissfully unaware or "how you're supposed to do it", using different mechanisms for this purpose, but I find the documentation decidedly unclear. Care to explain it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Mysterious Disapperance of file contents
by diotalevi (Canon) on Aug 29, 2003 at 03:56 UTC | |
by BrowserUk (Patriarch) on Aug 29, 2003 at 04:15 UTC | |
by diotalevi (Canon) on Aug 29, 2003 at 04:17 UTC | |
|
Re: Re: Re: Mysterious Disapperance of file contents
by aquarium (Curate) on Aug 29, 2003 at 10:15 UTC | |
by Abigail-II (Bishop) on Aug 29, 2003 at 11:02 UTC | |
by fraktalisman (Hermit) on Aug 29, 2003 at 13:27 UTC |