Regarding file locking...

cosimo on 2008-05-22T21:20:59

This should have gone out as a reply to AdamK, but use.perl.org doesn't want to collaborate. Sorry Adam.

For sure, if there's one thing that's a pain is file locking. I have no recommendations for you, but recently for $work, I wrote a class for general file locking, not just a script (yes, I know, don't tell me).

For about 6-7 years I've been using Fcntl and flock without problems, but now it's different. I need to gracefully handle file locking even on NFS volumes and with many concurrent hosts that write on the same nfs share.

And yes, it's crazy. And no, File::NFSLock doesn't work for me. LockFile::Simple does, but needs to be tweaked, hence my class that extends and "fix" it... :)

Me too: any recommendations?


Would any old lock work?

phillup on 2008-05-22T23:58:45

I probably should not even admit in public that I did/do this.

But...

I build web apps that sometimes need "locking", and the app may actually be running on multiple machines between requests. (or even at the same time)

So...

I use this. (figured they already solved the locking problem... I might as well use it)