Great Circle Associates Majordomo-Users
(June 2000)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Odd digest problem II - MJ's Revenge!
From: Mike Oliver <Mike . Oliver @ eng . sun . com>
Date: Tue, 27 Jun 2000 11:17:33 -0700 (PDT)
To: majordomo-users @ GreatCircle . COM
Cc: jh @ brainiac . com
Reply-to: Mike Oliver <Mike . Oliver @ eng . sun . com>

Joe Hartley <jh@brainiac.com> wrote:
>Dan Liston <dliston@netscape.com> wrote:
>> I recall seeing a post in this list (this year) about digests having
>> this type of problem.  The solution was to edit the digest script and
>> add the word sort somewhere, but you would have to check the archives 
to
>> see where.  I just don't remember.
>
>Thanks, I'll try again.  The searchable archives seem to stop at some
>point before that, and unfortunately the ones at GreatCircle aren't
>searchable, which surprises me.  Heck, even I manage to get that!

At about line 174 of the 'digest' script, between the existing lines:

   173   &abort("No messages.\nStopped ") unless @files;
   174   open(TEMP,">$TEMP") || &abort("$TEMP: $!\n");

(line numbers shown for reference) insert the line:

         @files = sort(@files);

There are terser ways of achieving this, I'm deliberately keeping it
simple.

The problem is that the 'readdir' function used by the 'digest' script
returns a list of filenames in an unspecified order.  The order usually
has a direct relationship to the directory maintenance policy of the
underlying filesystem.  If the digest member files are placed in
arrival order into an empty directory on a typical Unix filesystem then
'readdir' will return the names in the expected order and everything
works, but that's really just accidental.  If there's any file deletion
activity in the directory while the digest files are arriving then the
order of the list returned by 'readdir' will be scrambled.  Adding the
'sort' statement forces the filenames into the expected ascending order
regardless of how 'readdir' behaves.

Mike.
-- 
mike.oliver@eng.sun.com



Indexed By Date Previous: 550 World Writable directory
From: Liza Deatrick Peak <liza@bannister.com>
Next: Re: A few questions...
From: The Hermit Hacker <scrappy@hub.org>
Indexed By Thread Previous: Re: Odd digest problem II - MJ's Revenge!
From: Joe Hartley <jh@brainiac.com>
Next: Resend errors
From: John Poltorak <jp@mail.eyup.org>

Google
 
Search Internet Search www.greatcircle.com