vickycanada:

Hint: Try printing the contents of $destinationFilePath, and you'll get a hint at the problem you're likely having:

print "<$destinationFilePath>\n";

I expect you'll see something like "<\mftshare-devTeststomoutputTest1>". Backslashes in double-quoted strings need to be escaped, otherwise they're interpreted as escaping the next character found.

Oh, yes, one thing I forgot to mention (it bit me before). Sometimes your files may not be *complete* when they appear, so you need to be sure to delay processing the files until you're certain that they're done. I've had processes that would generate files, but would take several minutes to complete. Normally, I'd simply track the size of the file as well as the time I last saw the size of the file change. Then I'd process the file only after a reasonable amount of time after the file stops changing in length.

You generally only have to do this when the file is being generated in or copied to the target directory. To avoid those problems, I generally advise people to generate/copy them into a temporary or working directory, and then move them to the target directory once generation/copy is complete. (Generally a move/rename operation is atomic/effectively instantaneous, so you don't need to worry about processing an incomplete file.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re^6: Check multiple file names exist in directory and create another trigger file after existing files processed by roboticus
in thread Check multiple file names exist in directory and create another trigger file after existing files processed by vickycanada

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.