in reply to Re^2: Cannot copy files from linux shared to windows
in thread [Solved] Cannot copy files from linux shared to windows

It says Copy failed: at copyfile.pl line 24

That's not good enough :)

What is line 24?

Is it the call to File::Copy::copy()

or to  'cp -r ($File::Find::name, $target)'

backticks do not communicate errors via $!

You might try dying via sub Fudge for File::Copy::copy and Capture::Tiny for "cp.exe"

Replies are listed 'Best First'.
Re^4: Cannot copy files from linux shared to windows
by bbb (Novice) on Nov 06, 2014 at 00:12 UTC

    My bad, line 'cp -r ($File::Find::name, $target)' should not be included. I had updated the script without the "cp -r" line.

    line 24 is "copy ($File::Find::name, $target) or die "Copy failed: $!";

    The whole line I found in log file is "Copy failed: at copyfile.pl line 24 <$file> line 14."

      Yeah, that doesn't include a value for $! which is very weird .... which is why you should use Fudge() to get more info

      Also what version of perl do you have, and what filenames are involved?

      Do a Data::Dump::dd( $source, $target ) and post that

      Then try File::Copy::copy( ... ) or die Fudge(); where ... is copy/paste of ::dd output

      Then try getting/installing the latest http://perl5.git.perl.org/perl.git/history/HEAD:/lib/File/Copy.pm and try again

      File::Copy::copy shouldnt die without setting $!