I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Programming » C/C++ »

How to optimize fgets file read time

Ajin\′s Photo
5 Dec 12, 2:42PM
(1 reply)
How to optimize fgets file read time

I am reading a notepad file(contains matrix value datas) using following C programming


fgets( cpReadString, 6144, fStream )

but due to '6144' count, it is taking three

seconds to read. I want to reduce the time to zero seconds, can somebody help me out

to solve this issue.

will\′s Photo
6 Dec 12, 12:46PM
Does you get a sensible speed if you use
fgets( cpReadString, 100, fStream )

If so then do repeated calls to fgets until you've download the entire file. For a large file this is the normal approach, though I agree that for only 6144 bytes you should be able to read this all at once.

Are you accessing across a network?
Currently you need to be logged in to leave a message.