file locking...

zugnush zugnush at
Sun Mar 1 21:24:25 CET 2009

You could do something like this so that  every process will know if
the file "belongs" to it without prior coordination, it  means a lot
of redundant hashing though.

In [36]: import md5

In [37]: pool = 11

In [38]: process = 5

In [39]: [f for f in glob.glob('*') if int(md5.md5(f).hexdigest(),16)
% pool == process ]

More information about the Python-list mailing list