in reply to How to use Labels
Are you under the assumption that if the file is already locked, flock will return with a false value? Because that is not the case. flock will block until it gets the lock. It will return only in rare cases, like the OS being out of resources. Trying to lock again in a tight loop isn't going to solve that problem! The flock also fails if the filehandle isn't open, and then it will keep failing!
-- Abigail
|
---|