_FNAME - find the file name associated with a stream.

(GCOS-8 only)

Usage:

#include <stdio.h>
name = _fname(fp);

Where:

FILE *fp;
refers to an open stream.
const char *name;
points to a character string holding the name of the file associated with "fp". If there is no such file name, "_fname" returns NULL.

Description:

"_fname" returns the file name (if any) associated with an I/O stream. The function is typically used in creating error messages.

Note that if you specified any passwords when you opened the file, the passwords will be part of the string returned by "_fname". Therefore you may wish to remove the passwords from the string before displaying the file name as part of an error diagnostic.

Copyright © 1996, Thinkage Ltd.