As far as know in the end of all files, specially text files, there is a Hex code for EOF or NULL character. And when we want to write a program and read the contents of a text file, we send the read function until we receive that EOF hexcode.
My question : I downloaded some tools to see a hex view of a text file. but I can't see any hex code for EOF(End Of File/NULL) or EOT(End Of Text)
ASCII/Hex code tables :
This is output of Hex viewer tools:
Note : My input file is a text file that its content is "Where is hex code of "EOF"?"
Best Answer
Traditionally, in some contexts there is a End-of-file 'character' - MS-DOS / CMD.EXE uses CTRL+Z - Linux uses CTRL+D
CTRL-Z is code 26, CTRL-D is code 4 in the ASCII table.
These are still in use in situations when you use
stdin
(in the meaning as applied in "C" programming and general console/tty IO).e.g.
The very same sequence works in Linux'en with the difference that you start with
and end with CTRL+D, then
cat myFile.txt
instead oftype
.... If you're programming though, you will hardly see any effects of these characters.
I am at this writing not aware of any function call that would stop at these characters.
Read the documentation for your software / library - if there is no statement about the effect of these, then you're not likely to see anything strange happen.
Line endings - CR and LF combinations, code 13 and 10 - is a bit different though, it can get quite messy if you transfer TEXT files from one system to another.
unix2dos
anddos2unix
are shell commands available on Linux'en - for this purpose.Sample bash session: