Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!texbell!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F. Haugh II) Newsgroups: comp.unix.wizards Subject: Re: how can I get filename from file descriptor? Message-ID: <17109@rpp386.cactus.org> Date: 7 Oct 89 14:28:33 GMT References: <9353@chinet.chi.il.us> <1639@cbnewsl.ATT.COM> <10850@smoke.BRL.MIL> <14280@super.ORG> <11099@smoke.BRL.MIL> <862@cirrusl.UUCP> <11113@smoke.BRL.MIL> <867@cirrusl.UUCP> <1189@necisa.ho.necisa.oz> <947@cirrusl.UUCP> Reply-To: jfh@rpp386.cactus.org (John F. Haugh II) Organization: TrishTrash Readers, Inc. Lines: 33 In article <947@cirrusl.UUCP> dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) writes: >In article <1189@necisa.ho.necisa.oz> boyd@necisa.ho.necisa.oz (Boyd Roberts) >writes: >>There is no EOF in UNIX; ... >>...A suitable stream line discipline would solve >>whatever your problem is. > >There *is* an EOF in UNIX. Enough UNIX documentation says it that I >believe it. Case closed. The only EOF UNIX has this lifetime is zero-length-read. Until you change your name to Ken Thompson, asserting UNIX needs a new EOF mechanism is only going to draw stares. The zero-length convention works -very- nicely compared to others I've had the misfortune to use. In particular, I'm much more fond of 'while (read (...) > 0)' over Pascals 'while not eof (hi_mom) ...' >The zero-length read/write strategy, besides not working for pipes, >also doesn't work with buffered streams. It's a pretty poor solution >at this time. Actually I think it's the best solution any has ever dreamt up. The only objects which I am aware of supporting multiple EOFs are tape devices [ and terminals, but more on that some other day ... ] The zero-length-read paradigm has a very intuitve meaning. It means there is nothing left to read ... -- John F. Haugh II +-Things you didn't want to know:------ VoiceNet: (512) 832-8832 Data: -8835 | The real meaning of MACH is ... InterNet: jfh@rpp386.cactus.org | ... Messages Are Crufty Hacks. UUCPNet: {texbell|bigtex}!rpp386!jfh +--------------------------------------