From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.bredband.com!bredband!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Checking for EOF Date: 13 Nov 2002 00:57:12 +0000 Organization: Naggum Software, Oslo, Norway Lines: 37 Message-ID: <3246137832742017@naggum.no> References: <4lm4057dr.fsf@beta.franz.com> <47kfj6be0.fsf@beta.franz.com> <3246042568510031@naggum.no> <4u1in4sot.fsf@beta.franz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: maud.ifi.uio.no 1037149033 14736 129.240.65.205 (13 Nov 2002 00:57:13 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 13 Nov 2002 00:57:13 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:46432 * Duane Rettig | I was responding to Marco's statement: | | | As a matter of | | fact, the semantic I have in mind in this case is: once you have seen | | a C-d, you have seen the EOF. Period. | | which might be read as "once my program sees an eof, it will never have to | read from that stream again". This would of course be disastrous, since | if that stream happened to be terminal-like, such a program would then | ignore data from the terminal forever. But this is how line-oriented terminal input is defined under Unix. You can actually send an end-of-file with a C-d after a C-j or C-d, as hard an end-of-file as it gets. The user has unceremoniously communicated his intent to terminate input to that particular process. It would be wrong for that process to continue to read from that terminal stream. However, if you do not use the line-oriented terminal mode under Unix, and instead go for device-level reads, there is no end-of-file and the source has to signal his intent to terminate communication with that process through a small ceremony, like C-x C-c or some other in-band mechanism, or, in the case of the appropriate hardware, something like loss of carrier and the like. In other words, if you accept line mode, you accept the whole protocol. If you reject line mode, you also reject the whole protocol. If you want a protocol, you have to implement it yourself on top of the raw stream. If you manage to do this, but you define some other meaning to end-of-file or C-d, that is of course your prerogative, but it is no longer the Unix line-oriented terminal protocol and should be properly identified. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.