CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Downloading file to local directory

 



chander1986
Novice

Jun 3, 2009, 1:33 PM

Post #1 of 1 (325 views)
Downloading file to local directory Can't Post

I have a file say at the following location on an ftp server
"/edgar/full-index/1993/QTR2".

I am downloading the file and storing it on my local machine. I want it to store it with the same folder hierarchy. For example, suppose my current folder is C: so after my code runs, the file should be at the following location,
"C://edgar/full-index/1993/QTR2".

The following is the code that i have written, but it is giving the following error:
Cannot open Local file C:/edgar/full-index/1993/QTR1: No such file or directory
at get-master.pl line 42





Code
 
use Net::FTP;
use strict;

my $start_year = 1993;
my $start_qtr = 1;



$ftp = Net::FTP->new(HOST) or die;
$ftp->login('anonymous')
$ftp->cwd("/edgar/full-index/$start_year/QTR$start_qtr") or die "$@";

$ftp->get('master.idx',"C:/edgar/full-index/$start_year/QTR$start_qtr") or die


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives