LFSTAT Function
Returns an expression containing status information about a specified file unit. This routine is for large files (>2.5 gigabytes on supported platforms only).
Usage
result = LFSTAT(unit)
Input Parameters
unit—The file unit (logical unit number) about which information is required.
Returned Value
result—A structure expression of type LFSTAT containing status information about unit.
Keywords
None.
Discussion
LFSTAT can be used to get more detailed information, as well as information that can be used from within a PV-WAVE program.
Example 1
To get detailed information about the standard input, enter the command:
INFO, /Structures, LFSTAT(0)
This causes the following to be displayed on the screen:
** Structure LFSTAT, 10 tags, 32 length:
UNIT | LONG | 0 |
NAME | STRING | '<stdin>' |
OPEN | BYTE | 1 |
ISATTY | BYTE | 1 |
READ | BYTE | 1 |
WRITE | BYTE | 0 |
TRANSFER_COUNT | DOUBLE | 0 |
CUR_PTR | STRING | '8112' |
SIZE | STRING | '10000' |
REC_LEN | LONG | 0 |
The fields of the LFSTAT structure provide the following information:
UNIT—The file unit number.
NAME—The name of the file.
OPEN—Nonzero if the file unit is open. If OPEN is 0, the remaining fields in LFSTAT contain no useful information.
ISATTY—Nonzero if the file is actually a terminal instead of a normal file.
READ—Nonzero if the file is open for read access.
WRITE—Nonzero if the file is open for write access.
TRANSFER_COUNT—The number of scalar data items transferred in the last I/O operation on the unit. This is set by the following routines: READ, READF, READU, PRINT, PRINTF, and WRITEU. TRANSFER_COUNT is useful when you are attempting to recover from input/output errors.
CUR_PTR—The current position of the file pointer, given in bytes from the start of the file. If the device is a terminal (ISATTY is nonzero), the value of CUR_PTR will not contain useful information.
SIZE—The current length of the file, in bytes. If the device is a terminal (ISATTY is nonzero), the value of SIZE will not contain useful information.
See Also
For background information, see the PV‑WAVE Programmer’s Guide.
Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.