The implementations on different platforms can introduce various
differences.
Remember, if you open file in the text mode, you cant read over the EOF
char.
This is a problem if the file is a binary file ( an image for example
).
Text files, are usually sequential ( you cant't seek random in file ).
The sequential mode is sightly faster as random access.
Also text files can be optimized for sequential access. This option
can improve significant file acces speed.
Read CreateFile documentation from Windows API.
If you use Windows, use CreateFile with SEQUENTIAL_SCAN flag instead of
fopen, or so. The improvement in read speed is spectacular !
utab wrote:
Dear all,
What are the advantages of binary files over text files? I would like
to search for a specific value of a variable in an output file, I was
doing this lately by the string library functions of the language. But
wondering the advantages of searching and reading from a binary file.
If the files get too large, I guess the advantage of reading from a
binary file is that it is much faster.
Regards,