Jon Ribbens :
> On 2017-04-20, Cameron Simpson wrote:
>> For myself, I like mkdir. It is portable. It is atomic. It fails if
>> the target exists. It works over NFS etc. It is easy.
>>
>> os.mkdir('lock')
>> ... do stuff ...
>> os.rmdir('lock')
>
> One downside to this is that if the proce
On 2017-04-20, Cameron Simpson wrote:
> Others have pointed the way to an exact implementation.
>
> For myself, I like mkdir. It is portable. It is atomic. It fails if
> the target exists. It works over NFS etc. It is easy.
>
> os.mkdir('lock')
> ... do stuff ...
> os.rmdir('lock')
One dow
On 18Apr2017 19:31, Matt wrote:
I have a number of simple scripts I run with cron hourly on Centos
linux. I want the script to check first thing if its already running
and if so exit.
In perl I did it with this at the start of every script:
use Fcntl ':flock';
INIT {
open LH, $0
On 2017-04-19, Matt wrote:
> I have a number of simple scripts I run with cron hourly on Centos
> linux. I want the script to check first thing if its already running
> and if so exit.
>
> In perl I did it with this at the start of every script:
>
> use Fcntl ':flock';
> INIT {
>
On 19/04/17 01:31, Matt wrote:
In perl I did it with this at the start of every script:
use Fcntl ':flock';
[snip]
How can I do something like this in Python?
>>> import fcntl
>>> help(fcntl.flock)
E.
--
https://mail.python.org/mailman/listinfo/python-list
I have a number of simple scripts I run with cron hourly on Centos
linux. I want the script to check first thing if its already running
and if so exit.
In perl I did it with this at the start of every script:
use Fcntl ':flock';
INIT {
open LH, $0 or die "Can't open $0 for lockin