🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3594

Re: Streams and eof()

#3594
From: Axel Thimm
Date: Tue, 05 Mar 1996 17:40
36 lines
2424 bytes
kanze@gabi-soft.fr (J. Kanze) wrote:

>In article <199603010214.VAA16273@pleiades.cs.rpi.edu>
>axl@zedat.fu-berlin.de (Axel Thimm) writes:

>|> I have had a look in the April draft, but I think that there is a small
>|> ambiguity about eof() methods in streams.
>|> Is the eof-flag raised, when the end of the stream is reached, or when
>|> an attempt to move past this end is made?
[...]
>|> Declaring the end of a stream as the first charachter _after_ the last
>|> character of the stream would rescue the expression, but wouldn't fit
>|> into a concept of an end. (Usually one thinks of an end as belonging to
>|> the whole)
>|> As I am rather convinced, that the eof is raised at an attempt to meove
>|> past the end, I'd like to ask how to check this in a binary file without
>|> having to perform a movement.

>You might want to try the function `peek'.  I tend to use this function
>a lot.  Basically, this forces a look-ahead, which will set the eof if
>there is nothing more there.

But I think that you can use this only with text streams, not with
binary streams (You would not be able to tell a eof-char from an
ordinary binary char).
===
Axel Thimm <axl@zedat.fu-berlin.de>
Freie Universitaet Berlin
===
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]
Technical Details
Message-ID: <4hgap6$6o7@fu-berlin.de>
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern
References: <199603010214.VAA16273@pleiades.cs.rpi.edu> <KANZE.96Mar4112305@gabi.gabi-soft.fr>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern
From: axl@zedat.fu-berlin.de (Axel Thimm)
Newsgroups: comp.std.c++
Subject: Re: Streams and eof()
Date: 05 Mar 1996 09:40:45 PST
Organization: FU Berlin, Fachbereich Physik, Institut fuer Theoretische Physik
Approved: austern@isolde.mti.sgi.com
Message-ID: <4hgap6$6o7@fu-berlin.de>
References: <199603010214.VAA16273@pleiades.cs.rpi.edu> <KANZE.96Mar4112305@gabi.gabi-soft.fr>
Reply-To: axl@zedat.fu-berlin.de
NNTP-Posting-Host: isolde.mti.sgi.com
X-Original-Date: Tue, 05 Mar 1996 03:00:50 GMT
X-Access: 16 17 19
X-Newsreader: Forte Free Agent 1.0.82
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBVAwUBMTx8rEy4NqrwXLNJAQG8XQIAwetfl9yOcz/cnZgxzeIt+dKgTrcJXlIg
 UFWdrjdr29SrE3IQmOrZhsGn0lvD+chZeyV+mzynL3wtOOlzep4uMQ==
 =Q4Y2
Originator: austern@isolde.mti.sgi.com