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

P

Peter Ivarsson

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
 
K

kondal

Peter said:
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
 
P

Peter Ivarsson

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
 
P

Peter Ivarsson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top