Re: Need Advice Help On Parsing A File



Ryan Davis wrote:
On Jun 28, 2009, at 01:05 , Robert Klemme wrote:

I assume for mbox files there is an established protocol how the
file locking works. You'll probably find it somewhere on the web or
someone more knowledgeable than me posts information here.

Unfortunately, no. It is server (both smtp and imap) and OS dependent.
sucks.

There are a handful of variants (from top of head: flock locking, and
dot-file locking). The best way of checking is to look at the source
code of something which accesses mbox files, and see what they do. e.g.
an MTA like exim (which has very clear source code), or an MUA like mutt
or pine. All these are written in C.

Alternatively, if you have control over the problem domain, consider
changing to Maildir.
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: Does file locking works with NFS on Solaris ?
    ... On NFS especially, you cannot use file locking and mmapon the same file ... happens if two different client systems try to mix the two at the same ...
    (comp.unix.solaris)
  • Re: Process synchronization for implementing a global lock
    ... These guys will provide you with file locking ... For process level locking I use fcntl under most unix. ... concurrent access. ... with this technique a static mutex object is required to avoid spawning ...
    (comp.unix.programmer)
  • Re: 7-STABLE NFS: fatal: "select lock: Permission denied"
    ... multiple access from different processes even on a single ... data corruption if locking isn't available. ... When mounted with the "nolockd" option, file locking is ... delivery to maildir-style INBOX is much safer even on NFS without locking. ...
    (freebsd-net)
  • Re: string substitution problem
    ... > Purl Gurl wrote: ... >> addressed via semaphore locking or one of my locking mechanisms ... This file locking is a problem specific to Win32 system, ...
    (comp.lang.perl.misc)