End-of-Transmission character: Difference between revisions

separated DOS into its own paragrpah
(Description is now more precise.)
(separated DOS into its own paragrpah)
In [[ASCII]] and [[Unicode]], the character with the value 4 is EOT. It can be referred to as control-D, <tt>^D</tt> in [[caret notation]].{{Fact|date=March 2009}}
 
== Meaning in UnixMS-DOS compatible operating systems ==
MS-DOS do not normally stick to the ASCII definition of EOT equaling control-D for its internal use but instead [[control-Z]] is used for signaling the end-of-file in text files. Communication applications like serial line terminal programs might still support that.
 
== Meaning in Unix compatible operating systems ==
In contrast to the DOS [[control-Z]] character, which signifies end-of-file in text files, in Unix, the end-of-file character (by default EOT) causes the terminal driver to make available all characters its input buffer immediately; normally the driver would collect characters until
 
it sees an end-of-line character. If the input buffer is empty (because no characters have been typed since the last end-of-line or end-of-file),
In contrast to the DOS [[control-Z]] character, which signifies end-of-file in text files, in Unix, the end-of-file character (by default EOT) causes the terminal driver to make available all characters its input buffer immediately; normally the driver would collect characters until it sees an end-of-line character.
a program reading from the terminal reads a count of zero bytes. In Unix, such a condition is understood as having reached the end of the file.
it sees an end-of-line character. If the input buffer is empty (because no characters have been typed since the last end-of-line or end-of-file), a program reading from the terminal reads a count of zero bytes.
a program reading from the terminal reads a count of zero bytes. In Unix, such a condition is understood as having reached the end of the file.
The terminal driver turns an end-of-line character into a newline (LF) but suppresses the end-of-file character.