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


Groups > comp.lang.c > #8373

Re: Determining EOF using fseek()?

From Uno <merrilljensen@q.com>
Newsgroups comp.lang.c
Subject Re: Determining EOF using fseek()?
Date 2011-07-16 23:21 -0700
Message-ID <98f9q3Fvt8U1@mid.individual.net> (permalink)
References <iug5sl$5je$1@speranza.aioe.org> <fe274d3d-e0e9-4d45-93f6-28ad49787963@h25g2000prf.googlegroups.com>

Show all headers | View raw


On 7/10/2011 11:40 PM, Squeamizh wrote:
> On Jun 29, 2:36 pm, Orion<w...@bigpond.net.au>  wrote:
>> Hey,
>>
>> I was wondering if it was possible to determine if you hit 'EOF' using
>> fseek? I'm using fseek to traverse through the file from start to end
>> and capturing the data into a linked list structure. However, my loop
>> doesn't seem to work well - it totally fumbles out actually:
>>
>> while ((a = fseek(fp,0,SEEK_CUR)) == 0){
>>          // code here
>>
>> }
>>
>> Its quite important for me not to disrupt the current position of the
>> cursor since I rely on that to fetch the data from the text file. I
>> thought that the loop would work fine since fseek only returns a
>> non-zero integer on an error but unfortunately this is not the case.
>> Anyone with suggestions with using fseek() or some other function?
>>
>> Any help would be greatly appreciated! Thanks.
>
> I guess you didn't like the answers you got in '04!
> http://groups.google.com/group/comp.lang.c/browse_frm/thread/8a2feab451c13f24/5cf24c8ad218b348


Hey, hey, now, let's not hate by default.

A lot of water under the bridge since then.
-- 
Uno

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


Thread

Determining EOF using fseek()? Orion <won@bigpond.net.au> - 2011-06-29 21:36 +0000
  Re: Determining EOF using fseek()? John Gordon <gordon@panix.com> - 2011-06-29 21:46 +0000
  Re: Determining EOF using fseek()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-06-29 21:51 -0400
    Re: Determining EOF using fseek()? John Gordon <gordon@panix.com> - 2011-06-30 03:55 +0000
  Re: Determining EOF using fseek()? David Thompson <dave.thompson2@verizon.net> - 2011-07-11 00:26 -0400
  Re: Determining EOF using fseek()? Squeamizh <squeamz@hotmail.com> - 2011-07-10 23:40 -0700
    Re: Determining EOF using fseek()? Uno <merrilljensen@q.com> - 2011-07-16 23:21 -0700

csiph-web