Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How to stop reading a file?

Reply
Thread Tools

How to stop reading a file?

 
 
siliconwafer
Guest
Posts: n/a
 
      12-30-2005
Hi All,
I want to know tht how can one Stop reading a file in C (e.g a Hex
file)with no 'EOF'?

 
Reply With Quote
 
 
 
 
Arne Schmitz
Guest
Posts: n/a
 
      12-30-2005
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/ ---]
 
Reply With Quote
 
 
 
 
Chuck F.
Guest
Posts: n/a
 
      12-30-2005
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/>
 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      12-30-2005
On 30 Dec 2005 04:06:09 -0800, in comp.lang.c , "siliconwafer"
<(E-Mail Removed)> 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 =----
 
Reply With Quote
 
Niklas Norrthon
Guest
Posts: n/a
 
      12-30-2005
"siliconwafer" <(E-Mail Removed)> 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
 
Reply With Quote
 
Eric Sosman
Guest
Posts: n/a
 
      12-30-2005
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
http://www.velocityreviews.com/forums/(E-Mail Removed)lid
 
Reply With Quote
 
SM Ryan
Guest
Posts: n/a
 
      12-30-2005
"siliconwafer" <(E-Mail Removed)> 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!
 
Reply With Quote
 
Afifov
Guest
Posts: n/a
 
      12-30-2005
can u give more details?

 
Reply With Quote
 
Joe Wright
Guest
Posts: n/a
 
      12-30-2005
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 ---
 
Reply With Quote
 
Afifov
Guest
Posts: n/a
 
      12-30-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to stop java service with command line parameter '-stop'? Will Java 1 11-02-2004 03:32 PM
How to stop a thread without using stop() Son KwonNam Java 11 04-09-2004 08:01 PM
Q. My browser doesn't stop, when I click on STOP. Jim Jones Computer Support 7 02-03-2004 09:47 PM
Stop Debugging doesn't stop in ASP.NET Matt Theule ASP .Net 7 07-24-2003 07:38 PM



Advertisments