Accessing Files Programmer's Guide (32650-90885)

198 Chapter14
Getting File Information
Displaying File Error Information
The intrinsic returns a 16-bit unsigned integer. If the files are an interactive pair, bit (15:1)
=1, or =0 if they are not. If the files are a duplicative pair, bit (0:1) =1, or =0 if they are not.
A file can be interactive, duplicative, or both. These attributes do not change between the
time the files are opened and the time they are closed. You can use FRELATE to obtain
information about files on all devices.
Displaying File Error Information
Several file system intrinsics are designed specifically for handling errors. If an I/O error
occurs, most file system intrinsics return a condition code indicating this.
FCHECK
The FCHECK intrinsic returns an error code that indicates the nature of a file system I/O
error. A table of error codes appears in the MPE/iX Intrinsics Reference Manual, or you
can use FERRMSG (described below) to display an error message.
FCHECK has five optional parameters. The
filenum
parameter indicates the file for which
error information is to be returned. If you set this parameter to zero, FCHECK assumes you
want information about the
last
failed FOPEN call. The error code is returned in the
errorcode
parameter.
NOTE
Do not use FCHECK to determine error conditions of you last failed HPFOPEN
intrinsic call. Error conditions associated with HPFOPEN are returned in the
HPFOPEN
status
parameter. Instead, you can use the HPERRMSG intrinsic to
return a message explaining the nature of an HPFOPEN intrinsic error or
warning.
Three other parameters give additional information about file system errors. The
tlog
parameter returns the number of half-words read or written if an I/O error occurs. The
blknum
parameter gives the logical record count for a spool file, or the physical record
count for any other type of file. The
numrecs
parameter returns the number of logical
records in the bad block.
You must use this intrinsic prior to calling FERRMSG, since the error code returned by
FCHECK is used as a parameter in the call to FERRMSG.
You use: To obtain information about:
FCHECK File system intrinsic error number
FERRMSG File system intrinsic error message
PRINTFILEINFO File information error display