Re: [DOS] Curious about EOF

new topic     » topic index » view thread      » older message » newer message

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?
> 

Hi Alex

'EOF' is more of a notion used in programming now, the actual 'EOF' occurs when
no more characters (or bytes) are returned from a read() type of call.

Different operating systems have differing conventions for what EOF means in a
line input situation; DOS uses Control-Z to mean "I am finished typing" and Linux
(POSIX specification I think) uses Control-D.

Some programs or operating system routines in DOS still honour ^Z to signal the
end of a text file, meaning you can have text followed by ^Z followed by more
text and when you read it only the first text will be loaded.  I wouldn't count
on that feature though, it has been years since I tried it.

Gary

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu