Re: what ascii symbol stands for EOF in windows based systems?
- From: "[Jongware]" <IdontWantSpam@xxxxxxxxxxx>
- Date: Mon, 19 Nov 2007 22:11:25 +0100
"Sarunas Kazlauskas" <referas@xxxxxxxxx> wrote in message
news:a95a6122-3ebc-42a6-bbdf-0cb7ebfb5fc9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
... or how do you know you've reached the end of txt file?
Taken all of the above answers into account, you should
- read the entire file into memory. Your read routine will tell you when there
are no more bytes -- don't worry, you can't read beyond a file end even if you
wanted to.
- if you treat this as a text file, check if it happens to end with a Ctrl+Z.
Most modern (> 1985!) programs don't close off, but if you expect legacy files,
you'll encounter them occasionally.
- If the last byte is a Ctrl+Z, there might be more. Some legacy files are
filled up to a sector size with Ctrl+Zs.
- If you *do* clip the Ctrl+Z at the end of a file, remember to check the rest!
There might be one right after the first line, and the rest of the file should
be discarded.
In short, don't bother at all if you aren't bothered about old files.
[Jongware]
.
- References:
- what ascii symbol stands for EOF in windows based systems?
- From: Šarūnas Kazlauskas
- what ascii symbol stands for EOF in windows based systems?
- Prev by Date: Re: what ascii symbol stands for EOF in windows based systems?
- Next by Date: Re: No difference on my machine
- Previous by thread: Re: what ascii symbol stands for EOF in windows based systems?
- Next by thread: Re: what ascii symbol stands for EOF in windows based systems?
- Index(es):
Relevant Pages
|
|