Re: [DOS] Curious about EOF
Alex Caracatsanis wrote:
>
> I know what EOF stands for (and that it's represented as ASCII 26/Ctrl-z),
> but I don't know how to think about it. Is it added automatically at the
> end of every file (text and binary)? By Euphoria itself? And there's no
> code I need to write to make this happen, is there? If a file was created
> with a different language (eg a text file created with Java), would EOF be
> represented differently? Would an Eu program be able to read it? And is
> there a way to "see" it or reveal its presence (like '\n' or '\r', for
> example), or is it a silent thing?
>
> Thank you
>
> Alex Caracatsanis
Hi Alex,
I think it is some obsolete thing.
Say, Turbo Basic ends its source files with that EOF byte, but does
understand and runs source files *without* that EOF too.
Say, if you try a commmand:
>copy con aa.txt
and then Ctrl-Z it, the aa.txt file has *no* EOF byte at all,
so Ctrl-Z serves just to abandon copeing from keyboard to aa.txt file.
Then, *no one* Euphoria source file has the EOF byte.
But binary executable files have a lot of EOF bytes in the middle of them,
it is just some machine command, not the 'end of file' mark.
So I believe EOF came to us from the old telegraphic hardware and
has not too much sense now, at least in Euphoria programming.
Regards,
Igor Kachan
kinz at peterlink.ru
|
Not Categorized, Please Help
|
|