fstat
Function
fstat invokes the fstat callable service to get status information about a file that is identified by its file descriptor.
Parameters
- fd
- The file descriptor (a number) for the file.
- stem
- The name of a stem variable used to return the status information.
Upon return, stem.0 contains the number
of variables that are returned. To access the status values, you can
use a numeric value (see REXX predefined variables)
or any of the predefined variables that begin with ST_. For example, stem.9 and stem.st_atime are
both the request for the time of last access.
Variable Description ST_AAUDIT Auditor audit information ST_ACCESSACL 1 if there is an access ACL (access control list) ST_ATIME Time of last access ST_AUDITID RACF® File ID for auditing ST_BLKSIZE File block size ST_BLOCKS Blocks allocated ST_CCSID Coded character set ID; first 4 characters are the file tag ST_CRTIME File creation time ST_CTIME Time of last file status change ST_DEV Device ID of the file ST_DMODELACL 1 if there is a directory model access control list (ACL) ST_EXTLINK External symbolic link flag, set to 0
or 1ST_FID File identifier ST_FILEFMT Format of the file. To specify the format, you can specify a numeric value (see REXX predefined variables) or one of the following predefined variables used to derive the appropriate numeric value: - S_FFBINARY
- Binary data
- S_FFCR
- Text data delimited by a carriage return character
- S_FFCRLF
- Text data delimited by carriage return and line feed characters
- S_FFCRNL
- A text file with lines delimited by carriage-return and newline characters.
- S_FFLF
- Text data delimited by a line feed character
- S_FFLFCR
- Text data delimited by a line feed and carriage return characters
- S_FFNA
- Text data with the file format not specified
- S_FFNL
- Text data delimited by a newline character
- S_FFRECORD
- File data consisting of records with prefixes. The record prefix contains the length of the record that follows.
ST_FMODELACL 1 if there is a file model ACL ST_GENVALUE General attribute values ST_GID Group ID of the group of the file ST_INO File serial number ST_MAJOR Major number for a character special file ST_MINOR Minor number for a character special file ST_MODE File mode, permission bits only ST_MTIME Time of last data modification ST_NLINK Number of links ST_RTIME File backup time stamp (reference time) ST_SETGID Set Group ID on execution flag, set to 0
or 1ST_SETUID Set User ID on execution flag, set to 0
or 1ST_SIZE File size for a regular file, in bytes. If file size exceeds 231-1 bytes, size is expressed in megabytes, using an M (for example, 3123M). ST_SECLABEL Security Label ST_STICKY Sticky bit flag (keep loaded executable in storage), set to 0
or 1ST_TYPE Numeric value that represents the file type for this file. You can use a numeric value (see REXX predefined variables) or any of the predefined variables that begin with S_ to determine the file type: - S_ISCHR
- Character special file
- S_ISDIR
- Directory
- S_ISFIFO
- FIFO special file
- S_ISREG
- Regular file
- S_ISSYM
- Symbolic link
ST_UAUDIT Area for user audit information ST_UID User ID of the owner of the file
Usage notes
All time values returned in stem are in POSIX format. Time is in seconds since 00:00:00 GMT, January 1, 1970. You can use gmtime to convert it to other forms.
Example
In the following example, assume
that fd was assigned a value earlier in
the exec:
"fstat (fd) st."