Thank you for the reply foobie. Are you suggesting something like the following, where I ls, copy the each file to the new appended filename, process each appended file, then move like this?

#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use File::Copy; $path = "/mnt/ldmdata/"; @site_array = ("karx", "kdlh", "kfsd", "kmpx", "kmvx", "kwbc"); $poll_time = 20; # sec between polls of all specified directories for (;;) { foreach $site (@site_array) { $file_dir = $path . $site; $archive_dir = $file_dir . "/archive"; mkdir "$archive_dir", 0755 unless -d "$archive_dir"; opendir(FILE, $file_dir) || die "Cannot open $file_dir"; @files = readdir(FILE); closedir(FILE); if(@files) { foreach $file (@files) { copy($file_dir . $file, $file_dir . $file . ".complete +"); pqinsert $file_dir . $file . ".complete"; move($file_dir . $file . ".complete", $archive_dir . $ +file . ".complete"); unlink($file_dir . $file); } } } sleep $poll_time; }

In reply to Re^4: Continuously polling multiple directories for file transfer? by pktrain
in thread Continuously polling multiple directories for file transfer? by pktrain

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.