home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / msdos / programm / 9326 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  1.6 KB

  1. Xref: sparky comp.os.msdos.programmer:9326 comp.lang.c:13609
  2. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!sdd.hp.com!uakari.primate.wisc.edu!eng.ufl.edu!manta!zzang
  3. From: zzang@stat.ufl.edu (Zhuo Zang)
  4. Newsgroups: comp.os.msdos.programmer,comp.lang.c
  5. Subject: Re: BC++2.0 lseek problem(ALSO:lseek() question)
  6. Message-ID: <1992Sep13.140705.9173@eng.ufl.edu>
  7. Date: 13 Sep 92 14:07:05 GMT
  8. References: <1992Sep13.011428.25100@eng.ufl.edu> <1992Sep13.043839.8659@waggen.twuug.com>
  9. Sender: news@eng.ufl.edu (Usenet Diskhog System)
  10. Distribution: usa
  11. Organization: University of Florida
  12. Lines: 26
  13. Originator: zzang@manta
  14.  
  15. In article <1992Sep13.043839.8659@waggen.twuug.com> alpha@waggen.twuug.com (Joe Wright) writes:
  16. >Using open() and read() and lseek() will usually guarantee
  17. >non-portability.  These are OS functions, not C functions.
  18. >More specifically, they are Unix functions and not MSDOS
  19. >functions.  I strongly reccommend fopen(), fseek(), etc.
  20. >
  21. >That aside, the main reason that seek doesn't work the same
  22. >on Unix text files and DOS text files is that DOS uses two
  23. >characters, \r\n, to terminate a line while Unix uses only \n.
  24.  
  25. but when we use open("foo.c", O_RDONLY|O_TEXT) in MSDOS,
  26. (the O_TEXT bit is default, I put here just for emphasizing)
  27. open() is supposed to skip the \r, so shouldn't have any problem.
  28. it turns out the open() in TEXT mode has problem in BC++2.0
  29.  
  30. >So the DOS text file has a few more characters in it than
  31. >the Unix one.
  32. >
  33. >-- 
  34. >Joe Wright  alpha@waggen.twuug.com  alpha@wyvern.twuug.com
  35.  
  36.  
  37. -- 
  38. Zhuo Zang[~{j0WA~}]
  39. Department of Statistics
  40. University of Florida            Email: zzang@stat.ufl.edu
  41.