The End Of File Mark Problem

Many programs used to determine where the end of a file was by looking for an end of file mark (ASCII code 26). The length of files on PCs is also stored in the file system (whether FAT, HPFS or NTFS) and most modern programs use this method to determine the file's length and don't use the end of file mark.

Some programs still use the end of file mark as an alternative to getting the file length from the file system. These programs still write an end of file mark in the end of files when they write them. My favourite text editor SPF/PC (which works exactly the same as the ISPF editor on the mainframe) does this.

Unfortunately, some programs have difficulties with the end of file mark - AOL's netscape and Microsoft's Internet Explorer being two obvious ones. If these programs find an end of file mark at the end of an HTML file they will display it (as a small box or right arrow). If they find it at the end of an independent Javascript then the Javascript will refuse to run.

The solution was simple - create a small program that will remove an end of file mark (if present) from the end of any specified file. So I have and what is more, the same source compiled to create 16 bit DOS, 32 bit OS/2, and 32 bit Windows programs that all do this.

If you are having this problem then please copy my program, all three versions are included so you can use whichever you need. They all run from the command line.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow