2012/10/18 Oscar Benjamin <oscar.j.benja...@gmail.com>: > > The lock is cooperative. It does not prevent the file from being > opened or overwritten. It only prevents any other process from > obtaining the lock. Here you open the file with mode 'w' which > truncates the file instantly (without checking for the lock). > > > Oscar
Very good thanks now I understood, actually my problem was in the assumption that it should fail when the lock is already taken, but by default lockf just blocks until the lock is released. It seems to work quite nicely so I'm going to use this.. -- http://mail.python.org/mailman/listinfo/python-list