Revered Monks...

Using ActiveState Perl 5.8.7.815 on Windows XP.

I've created a application that takes input from a spreadsheet and then moves PDFs from one directory to another on a networked server. I'm using File::Copy to move the PDFs. The spreadsheet contains about 2000 entries and is parsed into an array. The PDFs range in size between a 20kb to 25mb.

The key code snippet goes as:

#------------------- chdir $SearchDirectory; foreach my $file (@data){ if(-e $file){ move($file, $DestinationDirectory } } #--------------------

Here's the question...the script iterates through the array faster than Windows actually moves the files...that is, there is a delay between when the item is told to move the item and when the item shows in the $DestinationDirectory.

Is this problematic/dangerous? If I were to simply select and move the files manually through Windows the files would not move as quickly as the script does. Should I add a wait cycle or some form of confirmation inside the loop to ensure that the file is moved before the loop iterates? Obviously this would slow things down but that would ultimately be the point.

Cheers
phil

In reply to file::move and networks by philc

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.