Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can I check FTP return code in Pro*C

Re: Can I check FTP return code in Pro*C

From: Stan Milam <milam_at_metronet.com>
Date: 18 Jun 1998 17:42:12 GMT
Message-ID: <6mbjhk$lfq$1@newnews.metronet.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US