![]() |
How to stop reading a file?
Hi All,
I want to know tht how can one Stop reading a file in C (e.g a Hex file)with no 'EOF'? |
Re: How to stop reading a file?
siliconwafer wrote:
> I want to know tht how can one Stop reading a file in C (e.g a Hex > file)with no 'EOF'? Look up feof(). Arne -- [--- PGP key FD05BED7 --- http://www.root42.de/ ---] |
Re: How to stop reading a file?
siliconwafer wrote:
> > I want to know tht how can one Stop reading a file in C (e.g a > Hex file)with no 'EOF'? Where did you get such a big disk drive? Who put the endless file on it? What software did they use. Where did they get the data to write to the file? -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson More details at: <http://cfaj.freeshell.org/google/> |
Re: How to stop reading a file?
On 30 Dec 2005 04:06:09 -0800, in comp.lang.c , "siliconwafer"
<spdandavate@yahoo.com> wrote: >Hi All, >I want to know tht how can one Stop reading a file in C (e.g a Hex >file)with no 'EOF'? Stop calling fread() ? close the file? :-) Seriously however, read up on feof(). Mark McIntyre -- ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =---- |
Re: How to stop reading a file?
"siliconwafer" <spdandavate@yahoo.com> writes:
> Hi All, > I want to know tht how can one Stop reading a file in C (e.g a Hex > file)with no 'EOF'? Reading a file is not addictive, so it's just a matter of not reading any more from it. Btw, what do you mean with "with no EOF"? I can think of a few examples, like /dev/zero and /dev/random on unix systems, is that what you mean? /Niklas Norrthon |
Re: How to stop reading a file?
Chuck F. wrote:
> siliconwafer wrote: > >> >> I want to know tht how can one Stop reading a file in C (e.g a >> Hex file)with no 'EOF'? > > > Where did you get such a big disk drive? Who put the endless file on > it? What software did they use. Where did they get the data to write > to the file? He's probably writing a quality-control test program to make sure /dev/zero contains only zeroes ;-) -- Eric Sosman esosman@acm-dot-org.invalid |
Re: How to stop reading a file?
"siliconwafer" <spdandavate@yahoo.com> wrote:
# Hi All, # I want to know tht how can one Stop reading a file in C (e.g a Hex # file)with no 'EOF'? The system should report to stdio the end of a disk file and stdio reports that with EOF or NULL returns or feof. For a file like a serial port or keyboard, you may have to define your own protocol within the file to work the end. -- SM Ryan http://www.rawbw.com/~wyrmwif/ I ASSURE YOU WE'RE OPEN! |
Re: How to stop reading a file?
can u give more details?
|
Re: How to stop reading a file?
Afifov wrote:
> can u give more details? > About what? When you read this group, do you pay attention? -- Joe Wright "Everything should be made as simple as possible, but not simpler." --- Albert Einstein --- |
Re: How to stop reading a file?
Dear Joe,
I do read in this forum.But i believe that there is a couple of ways to go around reading a file without the use of eof, either by seeking to end of file through lseek, or getting size of the file and decrementing a counter (which would be initialized to file size) until it hits zero. It depends on the task. But thanks for the tip. |
| All times are GMT. The time now is 10:29 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.