Single Instance of app

Tim Hammerquist tim at vegeta.ath.cx
Tue Aug 28 01:54:15 CEST 2001


Me parece que Tim Peters <tim.one at home.com> dijo:
> [Tim Hammerquist]
> > ...
> > While I'm at it, I've never actually seen (nor needed, thus far) Python
> > code to get an atomic lock on a file.  What's the idiom in Python?
> 
> I'm not sure exactly what's meant by "atomic lock on a file", but you can
> study the std tempfile.py module for the excruciating dance needed to create
> temp files safely.

Thanks!

I just meant 'atomic' as far as avoiding the race condition. The
tempfile module uses the ((fd)?open|close) functions in the os module. I
would assume these are closer to the system calls like fopen() and
fdopen() than is the built-in open()?

Thanks again!

-- 
C combines all the power of assembly language with all
the ease of use of assembly language.
    -- trad



More information about the Python-list mailing list