All suggestions look OK, except... as far as I know, there's no way to create a true daemon under Windows: there's no fork()..:-).

So, I see two choices: 1) spend a week on writing (and three more on debugging) a Win32 service (cli/srv with pipes and msgs and stuff);

2) write
while(1) { if new_files(dir): send_m(..); bzz(60*60); }
-- and check periodically that it's running...:-).

For not to do it manually, you'll need another program usually called watchdog. Not sure if there's a "crontab" analog under W. If not, you could also put watchdog over watchdog over watchdog to increase the chances of the system always running, - unless you get another process crashing or memory-leaking or a virus or an Automatic Windows Update.:-)).

// Note that sleep doesn't "soak up resources in the meantime". Careful with memory alloc-n between cycles though.

In reply to Re: starting a script when a file appears in a directory by Mabooka-Mabooka
in thread starting a script when a file appears in a directory by Mattk470

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.