For this topic's original documentation, see the FID() Function - Get File Identification.
See the SETTERM documentation for an example of how to use this verb for applications that rely on the FID(0) and will be run in a Web browser.
In BBj, the FID() function returns the filename as reported by the operating system. In BBx, it returns the filename from the original OPEN. For example:
Assume that the actual filename reported by the operating system is MyFile.DAT.
In BBj, a filename of "MyFile.DAT" is returned.
In BBx, a filename of "myfile.DAT" is returned.
The file name in the FID differs in VPRO/5 and BBj when a file is opened using a segment from the PREFIX. In VPRO/5, the drive letter, prefix segment, and the file name are included in the FID. In BBj, the file name in the FID includes the drive letter, the directory, prefix segment, and file name.
For example, if the current drive is C:\ and current directory is \BBJ with a prefix including DY/, then opening a file named VM040 in the DY directory will return different results in Visual PRO5 and BBj. Visual PRO5 returns C:DY/VM040. BBj returns C:/BBJ/DY/VM040.
BBj attempts to optimize file access by not making unnecessary data server connections. This means that if a file is opened using data server syntax and does not need to actually make a connection to a separate data server, no connection is made and the file is opened locally. Therefore, the file path returned in the FID might not contain data server syntax. The path returned in the FID is the actual path used to open the file.
The FID() function returns a string describing the attributes of the
file currently OPENed on channelno.
If channelno was OPENed with
an alias and resulted in opening a BBj device, FID() returns only the
Channel zero refers to the terminal device. Normally, the value returned by FID(0) is the terminal alias (T0, T1, etc.). However, if BBj is running in background or with redirected standard I/O, the file name associated with channel 0 will be IO, which has no special capabilities other than to read and write data.
If the channel was opened without an alias, then FID() returns a string with the following information:
The FIN() Function may also be used to provide information about an open file.