bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] Lock with external program question


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] Lock with external program question
Date: Thu, 22 Sep 2005 11:06:31 +0300

Kostas Zorbadelos <address@hidden> wrote:

> Please discard this question. Our decision in not to use an external
> program (as it will spawn an external process).

OK. Nevertheless, here are the answers:

> > program. I imagine I will do 
> > 
> > - mu_mailbox_create (&mbox,path)
> > - mu_mailbox_open  (mbox, MU_STREAM_RDWR|MU_STREAM_CREAT)
> > - mu_mailbox_get_locker (mbox, &lock)
> > - mu_locker_lock (lock) (at this point my external program will spawn
> > and lock the file using its methods)
> > - do stuff with the mailbox...
> > - mu_locker_unlock (lock) (the external program spawns again)
> > 
> > Am I correct and if so,

Basically you are right, except that you will have to specify default
locker flags before calling mu_mailbox_create using
mu_locker_set_default_flags as mail.local does. 

> > where do I declare the external program and

This is done using mu_locker_set_default_external_program();

> > what arguments is it expected to have?

 -f NUMBER  If a lock already exists, break it if it is older than
            NUMBER seconds
 -r NUMBER  Retry acquiring the lock NUMBER times
 -u         Unlock existing lock

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]