Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Mailbox locking' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mailbox locking
Authored by: gshenaut on Jan 06, '05 05:08:12PM

The current hint won't need to deal with locking mailboxes, because it scripts Mail.app itself, but external programs that move messages around among mailboxes will have that problem.

It's easy enough to set up mailboxes & move messages around, but the most painful part is to lock the mailboxes while you are doing it. The best solution I've come up with so far is to applescript a brute-force "quit" before fidding around and a "run" afterwords. Is there a better way to do this?

Greg Shenaut



[ Reply to This | # ]
Mailbox locking
Authored by: kenahoo on Jan 06, '05 08:09:51PM

Yeah, instead of using AppleScript you can use Perl or a shell script, where you have flock() and lockfile, respectively. Those use the system's 'flock' call, which is what programs that manipulate mailbox files do behind the scenes.



[ Reply to This | # ]