TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: DAVID STUMPF
from: DAVID WILLIAMS
date: 1998-04-02 14:54:00
subject: Multiple eofs

-> DW> In any (reasonable) DOS, EOF is *not* just an ASCII character.
-> The DW> stuff that is recorded on a disk is a whole lot more complex
-> than it DW> appears "through" the DOS. There are extra bits that are
-> used for error DW> detection and correction. And there are codes for
-> things like EOF that DW> do not represent any regular characters. The
-> DOS handles everything, DW> and provides the outside world with
-> something that looks a whole lot DW> simpler than what is really on
-> the disk. It also ensures (or *should* DW> ensure) that there is only
-> one EOF in each file, at its very end.
-> DW> No?
-> You can add as many EOF characters to a file as you wish.  The first
-> one that basic encounters, will be reported as the end of file I
-> believe.  (It would make sense to me at least)
How do you write EOFs to a file? As I said, in every Disk Operating
System with which I am familiar, EOF is *not* an ASCII character. It's
one of the DOS's internal control codes, along with others that deal
with the chaining of disk sectors in a file, checksums that are used to
detect and correct errors, and so on. When you write a file, the DOS
automatically puts one of these secret EOFs on the end. If you append to
the file, the EOF that was there previously is removed, and a new one is
put at the end. When a file is read, the reading automatically ends at
the EOF. Since there is only one, at the end of the file, that is
obviously the correct place to stop. There is no way that a user,
working "through" the DOS, can stick EOFs into the middle of a file, or
append stuff after the EOF without removing it, or do anything else that
would lead to there being more than one EOF in a file. To do these kinds
of things, you'd have to work at the machine level, sending signals to
the disk drive that the DOS would never send. Sure this would be
possible, if you're a clever enough programmer, but why would you want
to do this?! And if you did, surely you would know how to read past
these EOFs.
                               dow
--- PCBoard (R) v15.3 (OS/2) 5
---------------
* Origin: FidoNet: CAP/CANADA Support BBS : 416 287-0234 (1:250/710)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.