#include <stdio.h> name = _fname(fp);
"_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.