Can we use eof() function in binary files??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sudha sinha
    New Member
    • Sep 2013
    • 1

    Can we use eof() function in binary files??

    then how to mark the end of a binary file??
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Yes you can, the end of the file doesn't need marking in binary or text files, the system can tell it's got to the end of the file because it has read all the data from it, i.e. the file was 231 bytes long and it has read 231 bytes. In fact I would imagine nowa days that the hard disk tells the system wen there is no more data to read but I don't know for sure.

    And strictly speaking all files are binary files, a text file is just a special case where you only pot a subset of the available binary values into the file, the ons corresponding to printable characters and control codes.

    Comment

    Working...