Re: feof(), fseek(), fread()
- From: Mark McIntyre <markmcintyre@xxxxxxxxxxx>
- Date: Sat, 24 Mar 2007 23:33:29 +0000
On 23 Mar 2007 18:47:49 -0700, in comp.lang.c , "ericun***"
<xuwenduan2010@xxxxxxxxx> wrote:
On 24 Mar, 01:40, Ben Pfaff <b...@xxxxxxxxxxxxxxx> wrote:
"ericun***" <xuwenduan2...@xxxxxxxxx> writes:
If fseek() always clears EOF, is there a way for me to fread() from an
offset of a file and still be able to detect EOF?
Please explain how the several previous answers to your several
previous similar questions are inadequate.
I still don't know how can I detect EOF
By readin the previous answers. All the IO functions return status
messages which will tell you when you found the end of a file.
I must be able to seek forwards and
backwards in the file, but I still don't know up to now how can I do
this without fseek(), that's why I posted this question.
You can do it with fseek, thats what its for. However its up to you to
ensure your seeks remain inside the file by some other means. A
trivial way to do this is to determine the file size never seek
further than that from the start of the file.
--
Mark McIntyre
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
.
- References:
- feof(), fseek(), fread()
- From: ericun***
- Re: feof(), fseek(), fread()
- From: Ben Pfaff
- Re: feof(), fseek(), fread()
- From: ericun***
- feof(), fseek(), fread()
- Prev by Date: Re: fseek()
- Next by Date: Re: feof(), fseek(), fread()
- Previous by thread: Re: feof(), fseek(), fread()
- Next by thread: Re: feof(), fseek(), fread()
- Index(es):