Rowan Sylvester-Bradley wrote: > >Does Mailman need to lock Mailbox files? If so, how does it do so?
Mailman locks lists, not Mailbox files. >My hosting company runs Mailman. I'm writing a script which modifies my >mailbox files to delete old messages, and I need to be able to lock the >files before I do so to stop any other process from trying to modify >them at the same time. The way that Mailman does this may give me a clue >how to do it... Locks are generally implemented as lock files. I.e. to lock a file named /a/b/c, attempt to create /a/b/c.lock (or some other file whose name is a function of /a/b/c). If that file doesn't already exist, you can access /a/b/c and then remove /a/b/c.lock when you have commited your changes. If it does already exist, the resource is locked by another process; you have to wait and retry. This scheme relies on every process wanting access to the resource obeying the same rules and using the same lockfile name. Fortunately, this is usually the case for Mailbox files. See man lockfile -- Mark Sapiro <[EMAIL PROTECTED]> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp