home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11508 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.8 KB

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