ft_xcopen() executes the command synchronously in the remote system.
Syntax
#include <ftapi.h> void *ft_xcopen(const struct ft_admission *admis, /* input */ struct ft_xcpar *par, struct ft_err *errorinfo, void *options); /* input*/
Parameters
admis
Specifications for the remote system (see section “ft_admission” (Specifications concerning the remote system)).
par
Specifications for the request which you declare in the structure ft_xcpar:
struct ft_xcpar { int xcparvers; /* input */ char *cmd; /* input */ enum ft_filetype type; /* input */ enum ft_encrypt encryption; /* input */ char *locccsn; /* input */ char *remccsn; /* input */ int retcode; /* output */ long long outlen; /* output */ long long errlen; /* output */ char *fud; /* input */ int fudlen; /* input */ enum ft_fncmode fncmode; /* Input */ };
The fields of the ft_xcpar structure have the following meaning:
xcparvers
Version of the data structure.
xcparvers must be supplied the value FT_XCPARV1
or FT_XCPARV2
.
cmd
The command that is to be executed on the partner system. The maximum value must not exceed the length specified in the field maxcmdlen of the ft_prop structure (see section “ft_properties - Determine properties of the program interface”).
type
Data type of the transferred user data (in stdout). The following values are permitted:
FT_TEXT
Specifies the transfer format as text. Tabulator expansion is deactivated (default value if a CCS name is specified for locccsn and/or remccsn).
FT_BINARY
Specifies the transfer format as binary without conversion. (Default value if no CCS name is specified in locccsn and remccsn.
encryption
Specifies whether the user data is to be encrypted. The following values are permitted:
FT_NOENCRYPT
User data is not encrypted (default value following initialization with binary 0).
FT_ENCRYPT
User data is encrypted. For this to be possible, openFT-CR must be installed. If the partner system cannot operate with encryption then the request is rejected.
locccsn
Specifies the designation of the coding (CCS name) that is to be used when writing the data for the default output. CCS name must be known in the local system.
If no coding is specified then the default value for coding set in the openFT operating parameters is used. The locccsn parameter must not be used in combination with FT_BINARY
.
remccsn
Specifies the designation of the coding (CCS-NAME) that is to be used when writing the data for the default output from the remote command. CCS name must be known in the remote system.
If no coding is specified then the character set specified via XHCS (BS2000 systems) or in the openFT operating parameters (other platforms) is used for coding. The remccsn parameter must not be used in combination with FT_BINARY.
retcode
Return code from remote command execution.
outlen
Number of read data bytes for stdout.
errlen
Number of read data bytes for stderr.
fud
Address of a data area for the so-called "Further Details" which can indicate a more detailed cause of error if errors occur. If NULL
is specified then no more detailed error cause is output.
fudlen
Length of the data area for fud.
fncmode
Specifies the file-name encoding-mode.
FT_FNCTRANS
Specification of the remote file name and follow-up processing for the remote system in transparent mode (compatible to the previous version; default value after initialization with binary 0).
FT_FNCCHAR
Specification of the remote file name and follow-up processing for the remote system in character mode. They are interpreted according to the character code of the remote system, i.e. for UNIX partners according to the openFT operating parameter option (ftmodo –fnccs) that has been set there. –fnc=c is only permitted for openFT partners as of openFT V12.1B. This functionality is only available if xcparvers is set to the value FT_XCPARV2
and the Options parameter is specified when ft_transfer 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
options must have the value FT_APIV3
. The specification of this parameter is mandatory. The construction of the ft_options structure is described in section “Version of the program interface”.
Return value
id | ID of the request. This must be specified for both ft_sdinfo() and ft_sdclose(). |
| Error. The error type is stored in errorinfo. |