Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #58017

Re: fread a file of unknown size

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: fread a file of unknown size
Date Mon, 09 Mar 2015 07:53:11 -0700
Organization None to speak of
Lines 19
Message-ID <87twxu2pew.fsf@kst-u.example.com> (permalink)
References <mdi5g9$9hc$1@reader1.panix.com> <mdimio$jt5$1@speranza.aioe.org> <mdiq3n$537$1@dont-email.me> <mdispa$ah5$1@speranza.aioe.org>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="c77ff4d35e33d1c939d3461ebde8dd0d"; logging-data="30075"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Y5UEqUo35382ZpMM0BrRc"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:T7H95VYdxqaiSud0G82d/C9/iUg= sha1:ZjvtBNQPnvx7hQ6r/QyOSFUBpZY=
Xref csiph.com comp.lang.c:58017

Show key headers only | View raw


glen herrmannsfeldt <gah@ugcs.caltech.edu> writes:
[...]
> Yes, but does the C standard allow for a file to reach EOF, and then,
> on the next read, not be at EOF?

I don't think so, but fseek() clears the end-of-file indicator.

> I did once (OS/2 1.0 days) port gnu tail to OS/2, and it did work.
> I didn't try very hard to figure out how it worked, just that it did.

I think tail (specifically `tail -f`) uses fseek(file, 0, SEEK_CUR).

[...]

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

fread a file of unknown size ruben safir <ruben@mrbrklyn.com> - 2015-03-08 14:47 -0400
  Re: fread a file of unknown size Richard Heathfield <rjh@cpax.org.uk> - 2015-03-08 18:59 +0000
    Re: fread a file of unknown size James Kuyper <jameskuyper@verizon.net> - 2015-03-08 18:21 -0400
      Re: fread a file of unknown size Keith Thompson <kst-u@mib.org> - 2015-03-08 18:43 -0700
    Re: fread a file of unknown size fmassei@gmail.com - 2015-03-08 15:41 -0700
      Re: fread a file of unknown size raltbos@xs4all.nl (Richard Bos) - 2015-03-10 16:04 +0000
    Re: fread a file of unknown size Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-03-08 18:44 -0400
  Re: fread a file of unknown size jacob navia <jacob@spamsink.net> - 2015-03-08 20:32 +0100
  Re: fread a file of unknown size Keith Thompson <kst-u@mib.org> - 2015-03-08 12:48 -0700
  Re: fread a file of unknown size glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-03-08 23:39 +0000
    Re: fread a file of unknown size James Kuyper <jameskuyper@verizon.net> - 2015-03-08 20:40 -0400
      Re: fread a file of unknown size glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-03-09 01:24 +0000
        Re: fread a file of unknown size Keith Thompson <kst-u@mib.org> - 2015-03-09 07:53 -0700
          Re: fread a file of unknown size glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-03-09 17:36 +0000
            Re: fread a file of unknown size Keith Thompson <kst-u@mib.org> - 2015-03-09 10:44 -0700
              Re: fread a file of unknown size glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-03-09 20:07 +0000

csiph-web