Getting the pathname from a FILE*.

Robert C. White Jr. rwhite at nusdhub.UUCP
Wed Jul 13 08:52:12 AEST 1988


in article <651 at umb.umb.edu>, karl at umb.umb.edu (Karl Berry.) says:
> The title says it all. Am I missing something obvious?
> The pathname doesn't seem to be a field in either the
> _iobuf or the structure returned by stat.
> ttyname or ctermid will give you the pathname
> of your terminal, but I want the pathname of an
> arbitrary FILE* I have fopen. Or am I missing some
> reason why this is not feasible?

At great risk of being wrong...

Since one i-node may have many file names I think that
the individual file name is disposed of as useless after
the object in question is opened.  The closest I can even
picture you getting is to retreive the inode number.

All else would seem to be un-workable.


Rob.

Disclaimer:  Then again, maby not.



More information about the Comp.unix.wizards mailing list