On Thu, 21 Sep 2000 05:21:27 -0600, Tom Christiansen wrote:

>=item perl6storm #0031
>
>Add pragma to auto-flock LOCK_EX any files opened O_WRONLY,
>and LOCK_SH otherwise.


Good idea. I thought of proposing something like this ages ago. Perl is
a high-level language, it must be thinkable to patch the functions where
the OS lets us down. File locking on Unixy systems is a prime example.

I do think that the lock should be exclusive if in read/write mode, too
("+<" et al), not just in write-only. If you don't wnat this sever
locking, relock it in another mode, or use sysopen.

And opening in ">" mode should NOT truncate the file before the file is
locked.

-- 
        Bart.

Reply via email to