Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!oliveb!tymix!cirrusl!sun505!dhesi From: dhesi@sun505.UUCP (Rahul Dhesi) Newsgroups: comp.unix.wizards Subject: Re: how can I get filename from file descriptor? Message-ID: <862@cirrusl.UUCP> Date: 18 Sep 89 18:29:15 GMT References: <9353@chinet.chi.il.us> <1639@cbnewsl.ATT.COM> <10850@smoke.BRL.MIL> <14280@super.ORG> <11099@smoke.BRL.MIL> Sender: news@cirrusl.UUCP Reply-To: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Organization: Cirrus Logic Inc. Lines: 31 In article <11099@smoke.BRL.MIL> gwyn@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 UUCP: oliveb!cirrusl!dhesi