FIB( ) |
Return File Information Block |
FIB(filespec [, ERR=stmtref] )
Where:
filespec |
Can be a numeric expression indicating the open channel number to use or a string expression containing the pathname or table name (if string is prefixed by the keyword TABLE) of the file to use. |
stmtref |
Program line number or statement label to which to transfer control. |
(TABLE support was added in PxPlus 2018 Update 1).
String, file information block description.
The FIB( ) function returns a character string containing a file information block description for an existing open file. This information may be passed to a FILE directive to subsequently recreate the file.
See File Information Functions Overview and PxPlus Standard Format for FIB(0) and FID(0).
Unlike FID( ), the FIB( ) function is not affected by emulation mode settings.
FID( ) Return File Information Descriptor
FIN( ) Return File Information
FILE Create New File from File Descriptor
'FF' File Format
'PO' Path Original
input "Enter filename:",F$
open (1)F$
if mid(fib(1),10,1)<>$02$ \
then print "Not a Keyed file"
The FIB( ), FID( ) and FIN( ) functions return file information, descriptors and blocks. FID( ) returns file characteristics or descriptors such as the type of file, size, keys (if applicable) and the absolute location (pathname) of the file on the disk system. FIB( ) always returns the information in PxPlus Standard Format. See FIB/FID Layouts.
PxPlus returns file identifiers for a file through either the FID( ) or FIB( ) function. Normally, these two functions will both provide the same information; however, to simplify conversion to PxPlus from various Business Basics, PxPlus returns one of five different formats for the FID( ) function, based on the setting of the 'FF' system parameter.
There is one exception to the above. For a device, the FID( ) function always returns only the device name. For example, FID(0) will yield the terminal identifier.
You can define the value returned by FID(0) externally using the environment variable PVXFID0 or internally using the SETFID directive. FIN( ) returns file information about the data structure (describing the physical aspects of a file such as maximum record, number of records, key size, record size).
PxPlus Standard Format for FIB(0) and FID(0)
The following tables describe the FIB(0) / FID(0) PxPlus standard format for 'FF'=0: Common Information, Keyed Files and Terminals.
Bytes |
Description (for Common Information Only) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
1,3 |
Current record count (if available) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
4,6 |
Characters 1 - 6 of filename (will include the path, if used) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
10,1 |
$00$ Indexed | ||||||||||||||||||||||||||||||||||||||||||||||||||||
11,1 |
External key size | ||||||||||||||||||||||||||||||||||||||||||||||||||||
12,3 |
Maximum number of records | ||||||||||||||||||||||||||||||||||||||||||||||||||||
15,2 |
Record size | ||||||||||||||||||||||||||||||||||||||||||||||||||||
17,1 |
Keyed file flag ($01$ if variable length records) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
18,1 |
Keyed file inventory threshold % | ||||||||||||||||||||||||||||||||||||||||||||||||||||
19,1 |
File type:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
20,1 |
External file handle | ||||||||||||||||||||||||||||||||||||||||||||||||||||
21,1 |
Current attribute byte | ||||||||||||||||||||||||||||||||||||||||||||||||||||
22,1 |
Current foreground colour | ||||||||||||||||||||||||||||||||||||||||||||||||||||
23,1 |
Current background colour | ||||||||||||||||||||||||||||||||||||||||||||||||||||
24,1 |
Reserved for future use | ||||||||||||||||||||||||||||||||||||||||||||||||||||
25,60 |
External file pathname |
The following table applies to keyed files, *MEMORY* files and external database files:
(Support to return key information on external database tables was added in PxPlus 2022 Update 1.)
Bytes |
Description (for Keyed Files Only) | |||||||||||||||||
85,384 |
A series of 4 or 8-byte extended entries (for extended key attributes). The maximum number of key segments can range between 48 and 96, depending on the number of 4 and 8-byte entries found. The first of each group of 4 bytes indicates the key number or contains $FE$ if the 4 bytes are an extension of the key descriptor:
|
Bytes |
Description (for Terminals Only) |
85,1 |
Current column |
86,1 |
Current line |
87,1 |
Maximum column |
88,1 |
Maximum line |
89,110 |
Window information (10 *11 byte entries for top 10 windows): (1,1) Window number |
213,12 |
Actual device type |
BBx® is a registered trademark of BASIS International Ltd.