PTH( ) |
Return Pathname |
PTH(filespec[,ERR=stmtref]) |
The following were added in PxPlus v7.00:
PTH(filename$ [, filename$, ...] [,ERR=stmtref]) | |
PTH(*DICTIONARY [,ERR=stmtref]) |
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. |
filename$ |
String containing filename(s) whose existence is to be validated and full pathname returned. |
stmtref |
Program line number or statement label to which to transfer control. |
(TABLE support was added in PxPlus 2018.)
Pathname of the open file specified by the value in filespec. | |
Full pathname of the file specified in the filename. If none of the filenames provided exist, an Error #12: File not found exception is generated. Any filename that starts with a square bracket (ODBC, Remote, or other special file type) is not validated but simply returned to the application. Multiple filenames may be provided, comma-separated. If multiple filenames are provided, the path of the first file found will be returned. Note:
| |
Pathname of the current data dictionary file open. |
The PTH( ) function returns the operating system path of the file specified. (The value returned is an ASCII string reporting the full pathname, including directories and the filename.)
If the file is a device (e.g. a printer), the device name is returned.
With "/usr/ar"as current directory:
open (26)"PRODFL"
print "Just opened file: ",pth(26)
....
->run
Just opened file: /usr/ar/PRODFL
PTH( ) returns the device name when the file is a device:
open (30)PRINTER$
?pth(30)
LPT1