You can use ft_reqstat() to determine the status of an asynchronous file transfer request.
Syntax
#include <ftapi.h> int ft_reqstat(const void *session, /* input */ long rid, /* input */ struct ft_status *stat, struct ft_err *errorinfo, void *options); /* input */
Parameter
session
Session ID of the session in which the status of the transfer request is to be determined.
rid
ID of the request for which the status is to be determined.
If the request was issued in a different session, the current session must be assigned the same working directory as the one in which the request was issued.
stat
Area in which the status information is written. The structure ft_status is used:
#define STAT_FUD_LEN 65 #define STAT_FN_LEN 128 struct ft_status { int ftstatvers; /* input */ enum ft_stat status; /* output */ char fn[STAT_FN_LEN] /* output */ long tid; /* output */ int msg; /* output */ char fud[STAT_FUD_LEN]; /* output */ };
ftstatvers
Version of the data structure.
ftstatvers must be supplied the value FT_STATV1
or FT_STATV2
.
status
Status of the request:FT_STATW
The request is waiting for execution.
FT_STATR
The request is being run.
FT_STATA
The request was aborted.
FT_STATT
The request is terminated.
fn
Local file name terminating with ’\0’. If the file name is longer than 128 characters, it is truncated.
tid
Transfer ID
msg
Message number of aborted or terminated requests (see the online help).
The ft_apivers field in the ft_options structure can be used to define the message number scheme that is to be used.
fud
"Further Details" terminated with '\0' which can indicate a more detailed cause of error if errors occur.
The fud parameter is only available if ftstatvers is set to the value FT_STATV2
and the options parameter is specified when ft_reqstat is called.
errorinfo
Area in which detailed information is stored if an error is encountered (see section “ft_err” (Error handling)).
The specification of this parameter is optional. If you do not require any more precise error information then you can specify the value NULL
for errorinfo.
options
The specification of the options parameter is optional. If the value NULL
is specified then message activity at the program interface is compatible with that of the program interface of openFT < V10.
Alternatively, it is possible to specify the ft_options structure (see section “ft_options” (Version of the program interface)) to activate the openFT message number scheme as of openFT V10 and the extensions to the function.
Return value
0 | No error. |
-1 | Error. The error type is stored in errorinfo. |