how can I get filename from file descriptor?

Leslie Mikesell les at chinet.chi.il.us
Wed Sep 20 04:59:45 AEST 1989


In article <11099 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>->If your pipe implementation is any good (most are not), simply write 0
>->bytes to it.

>I did say that most pipe implementations don't support this.
[...]
>I don't know whether or not the various flavors of streams do.
>Personally I think they should.

Better yet, make all of the "magic" properties of "first open"
and "last close" available via fcntl() or ioctl() depending on
whether it is file magic or device magic.  Then if the /dev/tty
approach is generalized to /dev/fdn, you could do anything to
an inherited file descriptor that you could if you had the name
except rename/move/remove it.  Do the current implimentations of 
/dev/fd allow you to chmod(/dev/fd4,mode)?  

Les Mikesell



More information about the Comp.unix.wizards mailing list