z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


stat

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

Read syntax diagramSkip visual syntax diagram
>>-stat--pathname--stem----------------------------------------><

Function

stat invokes the stat callable service to obtain status about a specified file. You specify the file by its name. If the path name specified refers to a symbolic link, the symbolic link name is resolved to a file and the status information for that file is returned. To obtain status information about a symbolic link, rather than the file it refers to, see lstat.

To use a file descriptor to obtain this information, see fstat.

Parameters

pathname
A path name for the file.
stem
The name of a stem variable used to return the information. Upon return, stem.0 contains the number of variables returned. You can use the predefined variables beginning with ST_ or their equivalent numeric values to access the values they represent. (See REXX predefined variables for the numeric values.)
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 1
ST_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 1
ST_SETUID Set User ID on execution flag, set to 0 or 1
ST_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 1
ST_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

The stem variable stem.st_type is a number that represents the file type for this file. You can use the predefined variables beginning with S_ or their equivalent numeric values to determine the file type. For example, if stem.st_type is S_ISDIR, the file is a directory.

Usage notes

All time fields in stem are in POSIX format. You can use gmtime to convert it to other forms.

Example

In the following example, assume that path was assigned a value earlier in the exec:
"stat (path) st."

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014