473,396 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 4225

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Joseph | last post by:
The idea is to show only one of the <Baby_Div> while hiding all the others. At the moment all I have managed to do is to show each <Baby_Div> in turn as expected, but the problem is that once a...
10
by: ThunderMusic | last post by:
Hi, How can I get if the Windows running is a server version? Is there a property somewhere that can tell me if the Windows version is a server edition (including server, advanced server, web...
0
by: Peter | last post by:
When I issue call sqlj.install_jar('file:///f:/jars/mail.jar','MAIL'); I get the messages SQL4301N Java or .NET interpreter startup or communication failed, reason
6
by: Dolphin White | last post by:
For example, I allocate some unmanaged resources in the static constructors, then how can I properly release the resource before the application exit? thx!
25
by: Zeng | last post by:
I finally narrowed down my code to this situation, quite a few (not all) of my CMyClass objects got hold up after each run of this function via the simple webpage that shows NumberEd editbox. My...
34
by: Tom | last post by:
I'd greatly appreciate advice and code snippets on how to create a ram disk within a C/C++ program. I also need to be able to determine the free space. Thanks in advance for any help.
25
by: sidd | last post by:
In the following code: int i = 5; ---it goes to .data segment int j; ---it goes to bss segment int main() { int c; int i = 5; ---stack
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.