|
|
|
I've done something similar in WebStack, although I imagine that my scheme could be substantially improved. See here:
http://www.boddie.org.uk/python/
...repository.html
Paul Boddie |
05/12/01 - 4:00 pm | #
|
|
Pardon my ignorance, but why create a directory rather than just a file with a distinctive name?
Alec Wysoker |
Homepage |
05/12/02 - 9:16 pm | #
|
|
The equivalent code creating a named file would look like :
if not os.path.isfile(filename):
h = open(filename, 'w')
h.write('')
h.close()
You've got a "race condition" between the first two line - if two processes attempt this at the same time.
os.mkdir(filename) is more "atomic" - if two processes attempt it at the same time it is up to the operating system to return an error to one of them. 
That is my understanding anyway.
Fuzzyman |
Homepage |
05/12/05 - 9:04 am | #
|
|
|
Commenting by HaloScan
|