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
DW> error detection and correction.
Howdy David,
Mostly right! Most of the file heading entries you are referring to happen
for *.COM and *.EXE files. The parity codes are a function of the disk drive
and the DOS kernel and are not accessable unless you directly read sectors
from the disk. I used to do that stuff way back {grin}.
The End-Of-File character CHR$(26) is a left over from CP/M and early DOS
programs. QuickBasic tries to stay compatible by observing it for text based
files. Some programs still put an EOF character at the end of text files.
Most newer programs do not. They go by the length stored in the directory
entry for the file.
The EOF character is ignored when opening a file for BINARY or RANDOM. If
CHR$(26) and some other lower 32 control codes appear inside a file, it's not
intended for sequential text access by opening the file for INPUT.
Chris
--- FMail 0.96â
---------------
* Origin: BIZynet - Worldwide Business via the E-Ways (1:15/55.1)
|