467,168 Members | 970 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,168 developers. It's quick & easy.

How to copy files from mapped drive to server via my machine?

Hi I am trying to copy files from mapped drive (J:\) to a different machine.
The perl script is going to run on my machine to copy files from one place to another.

File transfer works when i copy files from mapped drive to my machine but when I tried to copy over to different machine throws me an error:

Please help me recrify

Here is my perl script as follows:

Expand|Select|Wrap|Line Numbers
  1. use File::Copy; 
  2.  
  3. $dir="\\\\SOURCE\\PROD_LOGFILES\\LogFiles\\"; 
  4.  
  5. opendir(DIR, $dir) or die "can not open directory $dir: $! \n"; 
  6.  
  7. @files=readdir(DIR); 
  8. closedir DIR; 
  9.  
  10. foreach $file (@files) { 
  11.   if (-f "$dir$file") {   
  12.  
  13. $moveloc="\\\\TARGET\\D\$\\FMP Project\\Production Log Files\\";  
  14.  
  15. $old = "$dir$file"; 
  16. $new = "$moveloc"; 
  17. #copy($old, $new) or die "Copy Failed: $!"; #this line is working for my machine
  18. move($old, $new) or die "Copy Failed: $!"; 
  19. }
  20. }
  21.  
Oct 26 '10 #1
  • viewed: 2890
Share:
2 Replies
Expert
What error message do you receive?
Oct 28 '10 #2
Chorny
I tried running the script got below error:

C:\PERL\BIN>perl try_perl.pl
Copy Failed: No such file or directory at try_perl.pl line 18.

It seems didn't find the appropriate target directory to land files.

can you please guide.
Jay
Nov 1 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by durumdara@mailpont.hu | last post: by
reply views Thread by ade tether via .NET 247 | last post: by
8 posts views Thread by Chris Strobel | last post: by
6 posts views Thread by zerbie45@gmail.com | last post: by
4 posts views Thread by sajid_yusuf@yahoo.com | last post: by
1 post views Thread by nussu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.