critical sections protecting multiple processes (not threads)

Will Stuyvesant hwlgw at hotmail.com
Wed Mar 26 16:56:33 EST 2003


> [Skip]
>     [David]
>     David> Specifically, I want to test for the existence of a file and open
>     David> if non-existent in an atomic fashion.  Obviously, if I cannot do
>     David> this atomically, it is possible for the file to not exist when
>     David> the test is done but to exist before the creation is done.
> 
>     David> I don't really know where to look in the documentation for this.
>     David> Any help would be appreciated, as always.
> 
>     ...
>     http://groups.google.com/groups?q=python+file+access+os.open&hl=en&lr=&ie=UTF-8&oe=UTF-8&scoring=d&selm=mailman.1044021160.3038.python-list%40python.org&rnum=1
> 
> That should get you pointed in the right direction.

Not if he uses Windows with Apache for testing etc.  You are pointing
him towards creating special purpose *n?x links.

His problem has my interest too.  Is a create-directory-lock scheme
regarded good practice?




More information about the Python-list mailing list