file locking

Jeremy Howard jh_lists at fastmail.fm
Sun Jan 20 18:41:04 CST 2002


> I now have another more generic question.
> What is the 'best' way to implment file locking to a  multiple access
file,
> from perl.
>
> in the past I have just created a 'lock' file (`touch lock`; do stuff;
> `rm -f lock`)
> but the must be a more elegant solution than this :)
>
It depends a little on how you're using it. You will find MLDBM::Sync
suitable for many problems that require shared access to files.





More information about the Melbourne-pm mailing list