.FNAME - find the file name for a unit.

Usage:

B:
   ret = .fname( unit [, string] );
C:
   char * _fname(FILE *unit, char *string );

Where:

unit
is the unit number whose file name is desired.
string
is a pointer to a vector of sufficient length to hold the filename string obtained. If this argument is specified, the filename string is copied into this vector.
ret
is zero if there is no file name for the unit. Otherwise, "ret" will be a pointer to the filename string. If "string" is supplied, "ret" will equal "string"; if not, "ret" will point to the filename string in the IOV.

Description:

This routine returns the file name (if any) associated with an I/O unit. .FNAME is principally used for error messages. If the specified unit is associated with a concatenated list of file names, .FNAME only returns the name of the file that is currently open.

You will probably want to use .FEDIT on the string returned by .FNAME before printing the string out. This removes any passwords which appear in the file name.

Notes:

The "string" argument is optional in the B version of the function, but must be present in the C version.

See Also:

expl b lib .fedit

Copyright © 1996, Thinkage Ltd.