how can I get filename from file descriptor?
Rahul Dhesi
dhesi at sun505.UUCP
Tue Sep 19 04:29:15 AEST 1989
In article <11099 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>I did say that most pipe implementations don't support this.
>Back in the days of Sixth Edition UNIX, several sites implemented
>"pipe internal EOF". It's clear that streams COULD implement this;
>I don't know whether or not the various flavors of streams do.
>Personally I think they should.
I think the wizards who are shaping the development of non-AT&T UNIX
should seriously consider including a general mechanism for sending an
out-of-band EOF. Right now the concept of a zero-byte read from a tty
meaning EOF, and the zero-byte-write method describe above, are
hack-ish.
We already have out-of-band EOFs and other data here and there in
arbitrary places: sockets have it, i'm told that TCP/IP supports some
sort of out-of-band data, and getc() supports it by returning int
instead of char. It would be nice to have a general mechanism for
communicating a non-stick EOF (an EOF that is not a permanent EOF).
For example:
write (fd, buf, -1); /* write non-stick EOF */
...
count = read (...);
if (count == 0 && errno == ENSEOF) {
... got non-stick EOF sent by writer ...
}
--
Rahul Dhesi <dhesi%cirrusl at oliveb.ATC.olivetti.com>
UUCP: oliveb!cirrusl!dhesi
More information about the Comp.unix.wizards
mailing list