I do not believe it, because the file * may be something that does not even have a name. Maybe it depends on the platform, depending on me. Your system, therefore, if you do not care about portability, try looking at the definition of your FILE compiler, if any. Most likely, your only way is to keep the name when you open it.
There are other potentially dangerous ways - check this link:
http://bytes.com/topic/c/answers/218921-how-get-get-filename-file-pointer
Hurrah!
source share