in reply to Re^4: how many instances are running ?
in thread how many instances are running ?

The locking mechanism seems to require a file that can be locked My first attempt resulted in a permission denied :)
Hmm, can we dig into that little problem, please?

Many systems only allow you to lock a file (actually a file handle) that you have open for writing. Once that condition is met, it really ought to work.

Oh, and if you try to lock the file in nonblocking mode, it won't wait but instead report failure to lock. Store that result and you will know whether to output anything, or not.

BTW I'd prefer to always enable warnings, but let every instance have their own copy for the log file.