Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-08-15 00:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?