ft_sdinfo() reads the file attributes of a directory in the remote system that were determined using ft_sdopen(). You can call ft_sdinfo more than once. On each call, the next data that has not yet been read is written to the buffer buf. If all the data has been read, the return value is 0.
Syntax
#include <ftapi.h> int ft_sdinfo(void *id, /* input */ struct ft_fileinfo *buf, int bufsize, /* input */ struct ft_err *errorinfo);
Parameters
id
ID of the request (return value from ft_sdopen)
buf
Area in which the file attributes are written. This area comprises elements with the structure ft_fileinfo:
#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 ft_fileinfo structure have the following meaning:
ftshowivers
Version of the data structure.
ftshowivers must have the value FT_SHOWIV2
. ftshowivers need only be set in the first passed data structure.
fn
File name or directory name
filetype
File type: FT_TYPEUNKN
Unknown file type
FT_BIN
Binary file
FT_DIR
Directory
FT_TXT
Text file
charset
Character set (only for text files): FT_NOSET
Unknown character set
FT_VISIBLE
The file can contain characters from the ISO646 G0 set.
FT_IA5
The file can contain characters from the ISO646 C0 set and G0 set.
FT_GRAPHIC
The file can contain characters from the ISO646 G0 set or from the ISO8859-1 G0 set and the ISO8859-1 G1 set.
FT_GENERAL
The file can contain characters from the ISO646 C0 set, the ISO646 or ISO8859-1 G0 set and the ISO8859-1 G1 set.
recordform
Record format: FT_NOFORM
Unknown record format.
FT_VARIABLE
Variable record length.
FT_FIXED
Fixed record length.
FT_UNDEF
Undefined record length.
recsize
Maximum record length or 0 if the maximum record length is unknown.
availability
Availability of the file: FT_NOAVAIL
The availability is not defined.
FT_AVAILIMM
The file is available immediately.
FT_AVAILNIMM
The file is not available immediately.
access
Access rights. The right is present 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 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 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 content.
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 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 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 file size unknown. The fsize parameter is only available if ftshowivers is set to the value FT_SHOWIV2
and the options parameter is specified when ft_showdir is called.
fmaxsize
Permissible file size in bytes, or -1 if file size unknown. The fmaxsize
parameter is only available if ftshowivers is set to the value FT_SHOWIV2
and the options parameter is specified when ft_showdir is called.
bufsize
Size of buf, i.e. maximum number of elements with the structure ft_fileinfo that can fit in buf.
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.
Return value
n | Number of elements written to the buffer buf. |
0 | No further data is available. |
-1 | Error. The error type is stored in errorinfo. |