Is there a unicode EOF mark like DOS ascii ctl-z or unix crl-d ?

Martin v. Löwis martin at v.loewis.de
Mon Sep 8 00:38:43 EDT 2003


bokr at oz.net (Bengt Richter) writes:

> I couldn't find one. (Hi Martin ;-)

No, there is no need to have one (neither is there a need to have one
for plain ASCII files): The end-of-file is when the file ends. Most
operating systems support a notion of a "file size", and the file ends
when file-size bytes have been consumed.

Why Microsoft decided to use ctr-z in text files is beyond me, it does
not fulfil any useful function. ctl-d on Unix is *not* an EOF mark: No
file ever contains ctl-d (or if it would, it would not be interpreted
as EOF mark). Instead, ctl-d signals the end of data entered into the
terminal (which does not have a pre-determined size), so ctl-d has its
usual EOT semantics in Unix.

So the question would only be meaningful if you had some device that
uses a character stream, instead of a byte stream. I'm not aware of
any such device - if you had one, recycling EOT would probably be a
good idea.

Regards,
Martin




More information about the Python-list mailing list