FID( ) |
Return File Information Descriptor |
FID(chan[,ERR=stmtref])
Where:
chan |
Channel or logical file number of the file to return information about. |
stmtref |
Program line number or statement label to which to transfer control. |
String, file information descriptor.
The FID( ) function returns a character string containing the file information descriptor for an existing open file. If the file is a device (printer, terminal, etc.), the filename used to open the file will be returned. If the file is a disk file, a file description string is returned. You can make subsequent use of this file description by passing it to a FILE directive to recreate the file.
See File Information Functions Overview and PxPlus Standard Format for FIB(0) and FID(0).
If you are running PxPlus in an emulation mode, the format of the information returned will be changed to reflect the system being emulated.
Determining FID in PxPlus Under UNIX
By default, PxPlus assigns a unique FID value for each terminal based on the /etc/initab entry for the terminal. Unfortunately, when you use dynamic terminal allocation (e.g. Telnet), each time a user signs off and then signs on, he/she will have a different FID value. There are workarounds; however, no one solution works in all instances. If, for security purposes, you use the User_ID rather than the Terminal_ID, you can set the file information descriptor in the user's profile by inserting the following lines:
PVXFID0=desired_FID_val
export PVXFID0
As an alternative, you can assign the file information descriptor once in PxPlus by issuing a SETFID directive to establish a new FID(0) value. If you do not want to use User_IDs but you are using Telnet and PCs, see if there is a host-initiated file transfer you could use to get a file containing the FID value off the PC.
Using WindX, you could open a file on the PC and read it to determine a FID value:
open (1)"[wdx]C:\PVXFID"
read record (1)F$
close (1)
setfid F$
Finally, you could see if the terminal emulator allows you to define values for function keys and has an escape sequence to send the values. Some terminals send a "HEREIS" string on receipt of an ENQ (Hex $05$); however, this varies from terminal to terminal.
Bytes |
Description (Total Length = 22 bytes) |
1,3 |
$000000$ |
4,6 |
Characters 1 - 6 of filename |
10,1 |
File type indicator: $00$ Indexed |
11,1 |
External key size |
12,3 |
Maximum number of records |
15,2 |
Record size |
17,4 |
Reserved for future use |
21,2 |
Characters 7 - 8 of filename |
Bytes |
Description (Total Length = 16 bytes) |
1,6 |
Characters 1 - 6 of filename |
7,1 |
File type indicator: $00$ Indexed |
8,1 |
External key size |
9,2 |
Maximum number of records (bytes reversed) |
11,2 |
Record size (bytes reversed) |
13,4 |
Not Used |
Bytes |
Description (Total Length = 9+ bytes) |
1,1 |
File type indicator: $00$ Indexed |
2,1 |
External key size |
3,4 |
Maximum number of records |
7,2 |
Record size (bytes reversed) |
9,... |
Pathname Example: set_param 'FF'=3 |
1,... |
Device name Example: set_param 'FF'=3 |
FID(4) is the same as FID(3); however, all serial files return a file type indicator of $03$ for binary. This format is only intended to facilitate program migration to PxPlus.
FIB( ) Return File Information Block
FIN( ) Return File Information
FILE Create New File from File Descriptor
'FF' File Format
'PO' Path Original