From: ara.t.howard@... Date: 2007-01-10T01:48:56+09:00 Subject: Re: recommended mailbox parsing library On Wed, 10 Jan 2007, Martin DeMello wrote: > > The following simple count-messages test returned the correct count, > but replaced my mailbox with a zero-byte file - any idea what I'm > doing wrong? This is with tmail 0.10.8 > > require 'tmail' > > i = 0 > > loader = TMail::UNIXMbox.new( 'mailbox' ) at_exit{ loader.close } > loader.each_port do |port| > mail = TMail::Mail.new(port) > i += 1 > puts i > end > > puts i you may also check to see if 'new' takes a block - not sure if it does. either way, the mbox can still be truncated if your process is 'kill -9'd. for that reason i generally impliment a transaction on top of tmail's. regards. -a -- in the practice of tolerance, one's enemy is the best teacher. - the dalai lama