Hi monks!

I made a perl program that parses the contents of an xml file into something more readable. The xml files who's filename include a date/time-stamp are arriving to our server every 15mins where they end up in a particular directory. There, the xml files are kept for 2 days until another process deletes them automatically.

My goal is to automate the checking for new files arriving in this directory (every 15mins), copy these new files into my working dir and feed them into the parser program. Like I said, the parser program is ready, what I need now is some way to:
- read the xml directory
- check for new files and ignore the ones already processed earlier
- copy the new files into my working dir where I can feed them into the parser program

Now for the actual question:
I'm sure File::Monitor could help out with a big chunk of the job but the likelihood of the server admin allowing me to install any additional perl modules is low. So, do you know of any (easy) way to achieve this without the help of any modules or is pushing the admin to install additional modules (File::Monitor) my best option?

Thanks,

//Ben


In reply to Monitoring directory contents by bendir

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.