The_Dj has asked for the wisdom of the Perl Monks concerning the following question:
This is on Windows 2003/ActivePerl 5.8, and the locking works.use Fcntl ':flock'; open (LF,'>>',$file); flock (LF,LOCK_EX|LOCK_NB) or die "Just one at a time, please"; select LF; $|=1; print "$$\n"; select STDOUT; ...snip... truncate LF,0; close LF; unlink $file; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File locking; downgrade an exclusive to a shared lock
by davido (Cardinal) on Jul 12, 2013 at 03:20 UTC | |
by The_Dj (Scribe) on Jul 12, 2013 at 04:30 UTC | |
|
Re: File locking; downgrade an exclusive to a shared lock
by Anonymous Monk on Jul 12, 2013 at 08:41 UTC | |
|
Re: File locking; downgrade an exclusive to a shared lock
by mtmcc (Hermit) on Jul 12, 2013 at 08:57 UTC | |
|
Re: File locking; downgrade an exclusive to a shared lock
by Anonymous Monk on Jul 12, 2013 at 05:01 UTC | |
by The_Dj (Scribe) on Jul 12, 2013 at 05:47 UTC | |
by hippo (Archbishop) on Jul 12, 2013 at 09:13 UTC |