Guardian Programmer's Guide

Table Of Contents
Using the File System
Guardian Programmer’s Guide 421922-014
2 - 26
Getting File Information
Getting File Information
The following related procedures provide information on all files: disk files, device files,
and process files:
Refer to the Guardian Procedure Calls Reference Manual for a complete description of
each of these procedures. This guide presents a brief overview.
Information provided by the brief-form procedures includes:
The name of the file and file-name length
The last error number returned from the file system
Device type and subtype, as well as information about the specific device type
The physical record length associated with the file
The extended-form procedures can return all the above, plus information about the
current position pointers, key values, access modes, exclusion modes, and so on.
One common use of the FILE_GETINFO_ procedure is to return the value of the last
file-system error. File-system errors are discussed in the next subsection.
Handling File-System Errors
An error number is associated with the completion of each procedure call to the file
system. The error number indicates whether the procedure executed successfully. If
the procedure did not execute successfully, then you can use the error number to help
determine what went wrong.
An error number is a 16-bit signed integer. To avoid using negative numbers, only
15 bits are used, yielding a range of error numbers from 0 up to about 32K. Error
numbers are categorized as follows:
Error number 0 indicates that the procedure executed successfully.
Error numbers in the range 1 through 9 are warnings. Warnings indicate that some
event has happened that may or may not be harmful to your process. For
example, reaching the end of file returns a warning error number.
FILE_GETINFO_ Returns brief information about an open file
identified by file number.
FILE_GETINFOBYNAME_ Returns brief information about a file identified
by file name. The file need not be open to get
information using this procedure.
FILE_GETINFOLIST_ Returns extended information about an open file
identified by file number.
FILE_GETINFOLISTBYNAME_ Returns extended information about a file
identified by file name.