how can I get filename from file descriptor?

Greg Pasquariello dune at cbnewsl.ATT.COM
Wed Aug 23 23:07:09 AEST 1989


In article <19208 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
:In article <20482 at sequent.UUCP> paulr at sequent.UUCP (Paul Reger) writes:
::What I mean is this ...
::Have the FILE structure have a name field in it:
::    char *name;
::then when the fopen() call is made, have it fill in the field ....
:
:This is all well and good, but you will have to define what happens
:when you ask for the name of stdin, stdout, stderr, or a file opened

:In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)

You also need to take into account actions on the fd itself, such as
unlink(fileno(fd)).

Greg Pasquariello
att!picuxa!gpasq



More information about the Comp.unix.wizards mailing list