Returns an expression containing status information about a specified file unit.
INFO, /Structures, FSTAT(0)
** Structure FSTAT, 10 tags, 32 length:
UNIT | LONG | 0 |
NAME | STRING |
'![]() ![]() |
OPEN | BYTE | 1 |
ISATTY | BYTE | 1 |
READ | BYTE | 1 |
WRITE | BYTE | 0 |
TRANSFER_COUNT | LONG | 0 |
CUR_PTR | LONG | 8112 |
SIZE | LONG | 0 |
REC_LEN | LONG | 0 |
NAME
OPEN
OPEN
is 0, the remaining fields in FSTAT contain no useful information.ISATTY
READ
WRITE
TRANSFER_COUNT
TRANSFER_COUNT is useful when you are attempting to recover from input/output errors.
CUR_PTR
ISATTY
is nonzero), the value of CUR_PTR
will not contain useful information.SIZE
ISATTY
is nonzero), the value of SIZE
will not contain useful information.REC_LEN
FUNCTION read_data, file
OPENR, /Get_Lun, unit, file
status = FSTAT(unit)
data = FLTARR(status.size / 4.0)
status
; gives the number of bytes in the file and single-precision
; floating-point values are four bytes each.
READU, unit, data
FREE_LUN, unit
RETURN, data
END
herc.dat
exists and contains 10 floating-point values, the following statements:
a = read_data('herc.dat')
herc.dat
.
INFO, a
A | FLOAT | = Array(10) |
For more information, see Getting Information About Files in Chapter 8 of the PV-WAVE Programmer's Guide.
For background information, see Logical Unit Numbers (LUNs) in Chapter 8 of the PV-WAVE Programmer's Guide.