home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
- From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
- Newsgroups: comp.lang.c
- Subject: Re: Turbo C Overlays and getchar problems.
- Message-ID: <1992Jul23.084038.26351@klaava.Helsinki.FI>
- Date: 23 Jul 92 08:40:38 GMT
- References: <1992Jul23.052720.28437@sfu.ca>
- Organization: University of Helsinki
- Lines: 30
-
- larrie@beaufort.sfu.ca (Larrie Simon Carr) writes:
- >First problem was using getchar, getc, etc to read an ASCII 13.
- >Why does this character get ignored? I can transfer the file
- >and the code to a Unix box and everything works fine.
-
- You are probably reading a file in "text mode" instead of "binary mode".
- Text mode means that the I/O library may convert the incoming bytes in
- more or less any way it wishes so that what the program sees will be
- as near as possible to the Unix model in which text files are ended with
- a single '\n', i.e. not '\r' then '\n', as in MS-DOS. In binary mode no
- such translation occurs. (This should be clearly explained in any
- decent C book.)
-
- >I am writing an application that I would like to have unload most
- >of its self (all but main() and the overlay handler) before
- >spawning to another application.
-
- For this you don't need overlays, you need something that swaps your
- whole application out while the other program runs. Try using archie to
- find spawno*.*, a library of routines by Ralph Brown (I think) that do
- exactly that. Some version can be found the comp.binaries.ibm.pc
- archives. Further discussion of spawning and swapping programs to disk
- should be taken to comp.os.msdos.programmer, since they are not relevant
- to comp.lang.c (so _edit_ your Newsgroups line!).
-
- (Of course, a better solution is to switch operating systems, but if
- you're stuck with DOS...)
-
- --
- Lars.Wirzenius@helsinki.fi
-