ProvideX V8.20 > Language Reference > 3. System Functions
436
FID( ) Function
                Return File Information Descriptor
Format
FID(chan[,ERR=stmtref])
Where:
chan
Channel or logical file number of the file to return information about.
stmtref
Program line number or label to transfer control to.
Returns
String, file information descriptor.
Description
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. For further information, refer to
the File Information Functions Overview, p.432 and the ProvideX Standard
Format for FIB(0) and FID(0), p.433.
If you are running ProvideX in an emulation mode, the format of the information
returned will be changed to reflect the system being emulated.
Note: When 'FF' is set to 0 or 3 and the 'PO' system parameter is switched on, the FID( )
and FIB( ) functions return the original path used when the file was opened.
Also: The FID( ) and FIN( ) format layouts will be changed whenever there is a change to
the 'FF' system parameter.
Determining FID in ProvideX under UNIX
By default, ProvideX 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, but no one solution
works in all instances. If, for security purposes, you use the user_ID rather than
terminal_ID, then you can set the file information descriptor in the users profile
by inserting the following lines:
PVXFID0=desired_FID_val
export PVXFID0
As an alternative, you can assign the file information descriptor once in ProvideX, 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; e.g.,
0010
OPEN (1) "[wdx]C:\PVXFID"
0020
READ RECORD (1) F$
0030
CLOSE (1)
0040
SETFID F$