1827324 Members
4526 Online
109962 Solutions
New Discussion

Re: Perl FTP Help

 
SOLVED
Go to solution
J. Callender
Frequent Advisor

Perl FTP Help

Following is snippet of my ftp script.

I'm getting the following error.

I appreciate all help.

ERROR: could not cwd D:\inetpub\ftproot\apl at get_apl_files.pl line 19.

Yes, that is the correct directory, and I do have accecc to that directory. I can login no problem.



my $path = "D:\\inetpub\\ftproot\\apl";

if ( my $ftp = Net::FTP->new($host) ) {
print "Logging in to '$host' as user '$user'.\n";

$ftp->login($user,$pw) or die "Could not login";
$ftp->pasv();
print "Changing directory to '$path'\n";
$ftp->cwd($path) or die "could not cwd $path";
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Perl FTP Help

Shalom,

D:\inetpub\ftproot\apl at get_apl_files.pl line 19.

Letter drives don't exist under Linux. Fix that code. OS is Linux?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
J. Callender
Frequent Advisor

Re: Perl FTP Help

Steven,

I'm getting the file from windows.
Mike Hassell
Respected Contributor
Solution

Re: Perl FTP Help

J,

Are you connecting to a Windows FTP server, or a linux FTP server? What platform are you connecting from?

It appears as if you want to ftp out of a linux box into a Windows FTP server. If so you shouldn't specify a full directory path to change to. Ex:

1. Windows FTP server is running and the default directory is c:\inetpub\ftproot.

2. When you login to FTP, you're already at that root and you'll want to 'CWD' into apl, which would put you in c:\inetpub\ftproot\apl.

3. Change your $path = "apl";

If you're trying to accomplish this in reverse, FTPing from a Windows box to a linux box, you'll want to use the proper win32 module:

http://www.digilife.be/quickreferences/QRC/PERL%20Win32%20Quick%20Reference.pdf

HTH.

Peace,
Mike
The network is the computer, yeah I stole it from Sun, so what?
J. Callender
Frequent Advisor

Re: Perl FTP Help

Mike,

I'm going from Lunux to Windows.

Your Solution work. Thanks for you help.


J. Callender
Frequent Advisor

Re: Perl FTP Help

Thread Close