All:
I want to thank everyone that gave me input. tye wrote a complete program within minutes. The problem was that it wasn't fast enough even though it has much better error handling. I came up with this:

#!/usr/bin/perl -w chdir "<directory>"; my @excludelist; my $excludefile = "<directory>/exclude"; my $count; while (1) { if ( -s $excludefile ) { open (EXCLUDE,"$excludefile"); @excludelist = <EXCLUDE>; close (EXCLUDE); } undef $/; @ARGV = <di*>; while (<>) { next if (grep /\b$ARGV\b/ , @excludelist); $count = s/\0{30}\t\0\0\(\0//g; rename $ARGV,"../capture/nested/$ARGV" if ($count >= 10); } $/ = "\n"; @excludelist = (); sleep 3; }

This screamed through a large list.

I also wanted to address the numerous people who suggested that there should be a better way to do this other than trying to move files on a live queue. I agree that if there was a way to get my propietary MTA to recognize this pattern and take a different action on them before writing them out it would be the best solution - but alas there is not.

This particular directory is where the messages sit once my MTA has completely processed them. What you say, your MTA is finished with them but doesn't send them along to the next MTA?

No, this particular propietary mail system waits for the distant end to establish an FTP session and download these mail messages.

Yes - mail being pulled via FTP

No - no better way to do it

Thanks again,
L~R


In reply to Re: Hitting a moving target (transient files) by Limbic~Region
in thread Hitting a moving target (transient files) by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.