I am experiencing some wierd issue with this piece of code. If there are multiple bad files in the source the move works fine with all but one file. The is the error i get. I dont understand how this could be a permissions issue when it works for all other files but one This is the error i see

can't copy bad file \\<server>/Data/DATA_DIR/INBOUND/TESTMD5/TESTFILE4.txt to import folde r \\server\Data\DATA_DIR\INBOUND\TESTMD5\import\TESTFILE4.txt.DUPLICATE: Permission denied

for my $file (@bad_files) { (my $volume, my $SrcDir_part, my $SrcPattern) = File::Spec->splitp +ath($file); my $outdir=File::Spec->catdir($SrcDir_part,"import"); $outdir = File::Spec->catdir($volume,$outdir); my $bad_file = File::Spec->catdir($outdir, $SrcPattern); $bad_file = "$bad_file\.DUPLICATE"; move($file, $bad_file) or $logger->logdie("can't copy bad file $fi +le to import folder $bad_file: $!"); #unlink $file or die "$? : $! - error"; push(@attach_list,"$bad_file"); }

In reply to Wierd move issue by sri1230

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.