You can use ft_show() to determine the attributes of an individual file or directory in the remote system. Use the function ft_showdir() to determine the attributes of several files.File names and directory names must not exceed the length specified in the maxrfnsize field of the ft_prop structure (see section “ft_properties - Determine properties of the program interface”).
Syntax
#include <ftapi.h> int ft_show(const struct ft_admission *admis, /* input */ const struct ft_shwpar *par, /* input */ struct ft_fileinfo *info, struct ft_err *errorinfo, void *options); /* input */
Parameter
admis
Transfer admission for the remote system (see section “ft_admission” (Specifications concerning the remote system)).
par
Entries for the request which you specify with the structure ft_shwpar:
struct ft_shwpar { int shwparvers; /* input */ char *fn; /* input */ char *mgmtpasswd; /* input */ char *fud; /* input */ int fudlen; /* input */ };
The fields of the structure ft_shwpar have the following meanings:
shwparvers
Version of the data structure.
shwparvers must be supplied the value FT_SPARV1
or FT_SPARV2
.
fn
Name of the file or directory for which the attributes are to be determined.
Absolute and relative path names are permissible. Relative path names refer to the login name specified in the admission profile, when the FTAC function is used, otherwise to the HOME directory, see "File transfer".
mgmtpasswd
Password of the file or directory if protected by a password.
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. The fud parameter is only available if shwparvers is set to the value FT_SPARV2
and the options parameter is specified when ft_show is called.
fudlen
Length of the data area for fud.
The fudlen parameter is only available if shwparvers is set to the value FT_SPARV2
and the options parameter is specified when ft_show is called.
info
Area in which the file attributes are written. The structure ft_fileinfo is used:
#define ACC_LEN 65 #define INFO_FN_LEN 257 #define LQ_LEN 81 #define USER_LEN 68 struct ft_fileinfo { int ftshowivers; /* input */ char fn[INFO_FN_LEN]; /* output */ enum ft_ftype filetype; /* output */ enum ft_charset charset; /* output */ enum ft_rform recordform; /* output */ long recsize; /* output */ enum ft_available availability; /* output */ int access; /* output */ char accout[ACC_LEN]; /* output */ long size; /* output */ long maxsize; /* output */ char legalqual[LQ_LEN]; /* output */ char cre_user[USER_LEN]; /* output */ long cre_date; /* output */ char mod_user[USER_LEN]; /* output */ long mod_date; /* output */ char rea_user[USER_LEN]; /* output */ long rea_date; /* output */ char atm_user[USER_LEN]; /* output */ long atm_date; /* output */ long long fsize; /* output */ long long fmaxsize; /* output */ };
The fields of the structure ft_fileinfo have the following meanings:
ftshowivers
Version of the data structure.
ftshowivers must be supplied the value FT_SHOWIV1
or FT_SHOWIV2
.
fn
File name or directory name.
filetype
File type:FT_TYPEUNKN
File type unknown.
FT_BIN
Binary file.
FT_DIR
Directory.
FT_TXT
Text file.
charset
Character set (only for text files):FT_NOSET
Character set unknown.
FT_VISIBLE
The file may contain characters from the G0 set of ISO646.
FT_IA5
The file may contain characters from the C0 set and the G0 set of ISO646.
FT_GRAPHIC
The file may contain characters from the ISO646 or from the G0 set of ISO8859-1 and the G1-Set of ISO8859-1.
FT_GENERAL
The file may contain characters from the C0 set of ISO646, from the G0 set of ISO646 or ISO8859-1 and from the G1 set of ISO8859-1.
recordform
Record format:FT_NOFORM
Record format unknown.
FT_VARIABLE
Variable record length.
FT_FIXED
Fixed record length.
FT_UNDEF
Undefined record length.
recsize
Maximum record length or 0, if record length unknown.
availability
Availability of file:FT_NOAVAIL
The availability is not specified.
FT_AVAILIMM
The file is immediately available.
FT_AVAILNIMM
The file is not immediately available.
access
Access rights. The right is available if the bit is set.
The following bits are defined:FT_ACCR
The file may be read.
FT_ACCI
File units may be added to the file.
FT_ACCP
The file may be overwritten.
FT_ACCX
The file may be extended, i.e. data can be added to the file.
FT_ACCE
File units may be deleted from the file.
FT_ACCA
File attributes may be read.
FT_ACCC
File attributes may be modified.
FT_ACCD
The file may be deleted.
account
Account number used to charge costs in the remote system.
size
Current file size in bytes, or -1 if file size unknown. In systems in which variables of type long
have a size of 32 bits, the value for the file size is truncated if it no longer fits in the field. The complete value for the file size can be found in the fsize field.
maxsize
Permissible file size, or -1 if file size unknown. In systems in which variables of type long
have a size of 32 bits, the value for the file size is truncated if it no longer fits in the field. The complete value for the file size can be found in the fmaxsize field.
legalqual
Legal qualification.
cre_user
User who created the file.
cre_date
Time at which file was created, or 0 if time unknown.
The time is specified in internal format (seconds since 1.1.1970 00:00:00).
mod_user
User who last modified the file contents.
mod_date
Time at which the file contents were last modified, or 0 if time unknown.
The time is specified in internal format (seconds since 1.1.1970 00:00:00).
rea_user
User who read the file last.
rea_date
Time at which the file was last read, or 0 if time unknown.
The time is specified in internal format (seconds since 1.1.1970 00:00:00).
atm_user
User who last modified the file attributes.
atm_date
Time at which the file attributes were last modified, or 0 if time unknown.
The time is specified in internal format (seconds since 1.1.1970 00:00:00).
fsize
Current file size in bytes or -1 if the file size is unknown. The fsize parameter is only available if ftshowivers is set to the value FT_SHOWIV2
and the options parameter is specified when ft_show is called.
fmaxsize
Current file size in bytes or -1 if the permitted file size is unknown. The fmaxsize parameter is only available if ftshowivers is set to the value FT_SHOWIV2
and the options parameter is specified when ft_show 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. No information supplied about the file. |