468,484 Members | 2,168 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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

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

Sep 12 '06 #1
3 4069

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

Sep 12 '06 #2
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
Sep 13 '06 #3
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
Sep 13 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Joseph | last post: by
25 posts views Thread by sidd | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by gieforce | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.