top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

If there is a huge TEXT of several GBs then what could the best way to read the file while considering performance?

+1 vote
229 views
If there is a huge TEXT of several GBs then what could the best way to read the file while considering performance?
posted Jul 7, 2015 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+3 votes

If you use fread to read a file of unknown size with a set buffer size of say 500 bytes, when you get to the end of the file you are likely to read a stub of 500 bytes of info and the eof marker.

And fread will not read that block and set and oef that can be read with feof. That is how I understand, so we can either use fseek to discover the file size and fread accordingly or use fstat?

Is this the proper approach?

+1 vote

Are there any defined rules that should be considered while writing function definition ?

...