Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP API, FTP Return Code

Status
Not open for further replies.

zbigbeer

Programmer
Apr 13, 2004
1
US
I'm a C++ developer who uses IBM's VisualAge C++ v5.0 product on AIX v5.2. I'm looking to transfer files between AIX hosts from within my C++ program, and was told that I should use FTP.
I could use the system() standard library function to issue the FTP command and sub-commands from within my C++ program. I could also get fancy and write a little program or script to issue the FTP command, and then call the script using the IOC class IExternalProcess (which enables me to service other threads while waiting for the FTP to complete).
The problem I am having is finding out whether or not the FTP was successful. There are circumstances when FTP returns zero (success) when, for example, the put sub-command I issue specifies a non-existent file.
Is there a FTP API available for doing FTP on an AIX box (from either within a C++ program or a script)? Should I look at alternatives to FTP?
I NEED TO KNOW IF THE FILE TRANSFER WAS SUCCESSFUL.
Any and all help is appreciated...
 
Our programmers are using uniVerse BASIC, but the technique they use should work for you.

They create an appropriate .netrc file to perform the ftp, then parse the output to determine success.

That said, I'd be suprised if there's not plenty of open source C++ implementations of FTP functionality out there. I'm a bit suprised that VisualAge doesn't have one included.



Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
CREATE-ACCOUNT
LOGTO <account>
CREATE-FILE <file>
BASIC BP <prog>
RUN BP <prog>
CATALOG BP <prog>

I did UniVerse Basic! What a trip!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top