Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Can't get automatic ftp working within system() method.

Reply
Thread Tools

Can't get automatic ftp working within system() method.

 
 
Peter Ivarsson
Guest
Posts: n/a
 
      09-12-2006
Hi,

I have a program that's creates a .netrc in $HOME.
When I at the AIX prompt write "ftp xxx.yyy.com", the ftp command
transfers a file to the remote host as I want.
When I in my code write "status = system( "ftp xxx.yyy.com" ).
I get the error below:
Connected to xxx.yyy.com.
220 buick FTP server (Version 4.1 Thu Sep 12 23:46:23 CDT 2002) ready.
Name (xxx.yyy.com:ZZZ): 331 Password required for ZZZ.
530 Login incorrect.
It seams that the ftp command doesn't find the .netrc in $HOME.
And that automatic login doesn't work.
But the $HOME is correct when I do 'system( "echo Dollar home = $HOME"
);'

This code is running in AIX 5.3.

Does anyone have a clue?

Best Regards
/ Peter Ivarsson

 
Reply With Quote
 
 
 
 
kondal
Guest
Posts: n/a
 
      09-12-2006

Peter Ivarsson wrote:
> Hi,
>
> I have a program that's creates a .netrc in $HOME.
> When I at the AIX prompt write "ftp xxx.yyy.com", the ftp command
> transfers a file to the remote host as I want.
> When I in my code write "status = system( "ftp xxx.yyy.com" ).
> I get the error below:
> Connected to xxx.yyy.com.
> 220 buick FTP server (Version 4.1 Thu Sep 12 23:46:23 CDT 2002) ready.
> Name (xxx.yyy.com:ZZZ): 331 Password required for ZZZ.
> 530 Login incorrect.
> It seams that the ftp command doesn't find the .netrc in $HOME.
> And that automatic login doesn't work.
> But the $HOME is correct when I do 'system( "echo Dollar home = $HOME"
> );'
>
> This code is running in AIX 5.3.
>
> Does anyone have a clue?
>
> Best Regards
> / Peter Ivarsson


..netrc is getting opened and is parsed by the ftp program. I think that
the password is wrong. Why don't you add -d option for the ftp command
to enable the debug messages. This enables you to see what message
transfer are going through between the server and the client.

ps. -d option for ftp gives debug messages in linux, hope it is same
for AIX

-kondal

 
Reply With Quote
 
 
 
 
Peter Ivarsson
Guest
Posts: n/a
 
      09-13-2006
HI,

You were right the user name was wrong.
But the user name was the LOCAL user name on my computer.
I still have the feeling that ftp is not reading the .netrc file
althouh it should.
Just as I only wrote ftp ftp.www.com and had no .netrc file.

Best regards
/ Peter Ivarsson

kondal wrote:
> Peter Ivarsson wrote:
> > Hi,
> >
> > I have a program that's creates a .netrc in $HOME.
> > When I at the AIX prompt write "ftp xxx.yyy.com", the ftp command
> > transfers a file to the remote host as I want.
> > When I in my code write "status = system( "ftp xxx.yyy.com" ).
> > I get the error below:
> > Connected to xxx.yyy.com.
> > 220 buick FTP server (Version 4.1 Thu Sep 12 23:46:23 CDT 2002) ready.
> > Name (xxx.yyy.com:ZZZ): 331 Password required for ZZZ.
> > 530 Login incorrect.
> > It seams that the ftp command doesn't find the .netrc in $HOME.
> > And that automatic login doesn't work.
> > But the $HOME is correct when I do 'system( "echo Dollar home = $HOME"
> > );'
> >
> > This code is running in AIX 5.3.
> >
> > Does anyone have a clue?
> >
> > Best Regards
> > / Peter Ivarsson

>
> .netrc is getting opened and is parsed by the ftp program. I think that
> the password is wrong. Why don't you add -d option for the ftp command
> to enable the debug messages. This enables you to see what message
> transfer are going through between the server and the client.
>
> ps. -d option for ftp gives debug messages in linux, hope it is same
> for AIX
>
> -kondal


 
Reply With Quote
 
Peter Ivarsson
Guest
Posts: n/a
 
      09-13-2006
Hi,

Mr Kondal was right that the user name was wrong.
But the user name was the LOCAL user name on my computer.
I still have the feeling that ftp is not reading the .netrc file
althouh it should.
Just as I only wrote 'ftp ftp.www.com' and had no .netrc file.

Best regards
/ Peter Ivarsson

kondal wrote:
> Peter Ivarsson wrote:
> > Hi,
> >
> > I have a program that's creates a .netrc in $HOME.
> > When I at the AIX prompt write "ftp xxx.yyy.com", the ftp command
> > transfers a file to the remote host as I want.
> > When I in my code write "status = system( "ftp xxx.yyy.com" ).
> > I get the error below:
> > Connected to xxx.yyy.com.
> > 220 buick FTP server (Version 4.1 Thu Sep 12 23:46:23 CDT 2002) ready.
> > Name (xxx.yyy.com:ZZZ): 331 Password required for ZZZ.
> > 530 Login incorrect.
> > It seams that the ftp command doesn't find the .netrc in $HOME.
> > And that automatic login doesn't work.
> > But the $HOME is correct when I do 'system( "echo Dollar home = $HOME"
> > );'
> >
> > This code is running in AIX 5.3.
> >
> > Does anyone have a clue?
> >
> > Best Regards
> > / Peter Ivarsson

>
> .netrc is getting opened and is parsed by the ftp program. I think that
> the password is wrong. Why don't you add -d option for the ftp command
> to enable the debug messages. This enables you to see what message
> transfer are going through between the server and the client.
>
> ps. -d option for ftp gives debug messages in linux, hope it is same
> for AIX
>
> -kondal


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sun.net.ftp.FtpProtocolException: Error reading FTP pending reply long990802@gmail.com Java 3 12-11-2005 02:46 AM
How to get FTP server working with new domain name? JD Computer Support 9 07-08-2004 10:32 PM
Automatic build process + automatic NuNit (2 in 1 solution) ASP .Net 1 06-29-2004 04:15 PM
Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server. D. Buck Perl Misc 2 06-29-2004 02:05 PM
FTP over SSL vs FTP over SSH someone Java 1 04-25-2004 03:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57