Re: what ascii symbol stands for EOF in windows based systems?



"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]


.



Relevant Pages

  • Re: Gradual Increase in memory usage
    ... Linux sees free memory, and rather than ... I'll be happy not to bother you about the tagline. ...
    (Fedora)
  • Serendipitous computer repair
    ... There was a thread not too long ago about computer memory; ... I had set that aside for when I want to bother to take ... boot up to Linux, and free reports about 56 MB of memory. ...
    (sci.electronics.design)
  • Re: Questions about malloc()
    ... >>is the only pointer to the memory being freed? ... >>are other copies lying around, how are you going to find ... > There are other ways of getting infected so why bother with condoms... ...
    (comp.lang.c)
  • Re: From the Vault IV
    ... actually I find VFTV IV routine in performance. ... I wouldn't bother with it & get something else instead, like the Hornsby one. ...
    (rec.music.gdead)
  • Re: .EXE -> .ASM -> .EXE
    ... "If i have a pretty big application, i will never bother about ... *trivial* routine parts of it. ... "Producing another problem with "version compatibility". ... mean resides not at the edge.." ...
    (alt.lang.asm)