Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Can I check FTP return code in Pro*C
layman_at_poboxes.com wrote:
: Dear all,
: I want to launch ftp within a Pro*C program but I want to check the
: return code of the ftp command. Is it possible?
: Kevin
int rc;
char ftp_cmd[] = "ftp -vn net_address <ftp_script 2>&1 | grep ^226 >/dev/null"
rc = system( ftp_cmd ) >> 8;
The ftp_script file is the list of ftp commands you want to execute. Example
user login password
binary
get some_file
bye
This is just a hint of how it might be done. I have written a function that I use in most of my programs which does all this. It is very complicated as it gets all the information it needs for the ftp script and IP addresses from the database. One thing you ought to do is first check to see if you can communicate with the remote host via the ping command.
Hope this helps,
Stan Milam
Received on Thu Jun 18 1998 - 12:42:12 CDT