News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

File Test

Started by cman, June 12, 2010, 08:54:14 PM

Previous topic - Next topic

tenkey

Quote from: cman on June 13, 2010, 04:00:47 PM
Ok , thanks for the information! Is there actually something at the end of the file that corresponds to a "end of file" character , or is that completely a high level language abstraction? Thanks.

It's a file format "abstraction". All files are binary, but some can be interpreted as text files. By definition, every byte in a binary file can have any byte value. This includes carriage return, line feed, "end-of-file", and zero-byte "characters".

A text file can be ASCII, ISO-7, or some form of Unicode. Depending on the software/hardware platform you're using, the text can vary as to how files and lines are terminated. The most obvious example is the difference between Linux/Unix and Windows text files. If you transfer files between your Windows system and a Linux web host, you need to be aware of the existence of the difference.

BTW, there is no standard EOF character. The value 0x1A (SUB, ctl-Z), which is recognized by some WIndows programs and libraries, is a legacy of the CP/M system. I have seen 0x19 (EM, ctl-Y) and 0x04 (EOT, ctl-D) used as EOF characters on ASCII-based systems.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8