home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16172 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.3 KB  |  30 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!think.com!ames!agate!usenet.ins.cwru.edu!ncoast!brown
  3. From: brown@NCoast.ORG (Stan Brown)
  4. Subject: Re: DEC VMS VERSION OF C - HOW TO ASSIGN FILE NAME?
  5. Organization: Oak Road Systems, Cleveland Ohio USA
  6. Date: Sun, 8 Nov 1992 19:35:47 GMT
  7. Message-ID: <BxEx3p.AHF@NCoast.ORG>
  8. References: <92310.16240634R33O7@CMUVM.CSV.CMICH.EDU> <1992Nov6.072147.16000@sbcs.sunysb.edu>
  9. Lines: 19
  10.  
  11. In article <1992Nov6.072147.16000@sbcs.sunysb.edu> rhorn@csws11.ic.sunysb.edu (Robert Horn) writes:
  12. >
  13. >Look up fopen (and fclose while you're at it) in your favorite C
  14. >book (which should be K&R 2nd Edition).
  15.  
  16. Ordinarily, this is good advice.  However, when dealing with a
  17. particular compiler it's generally advisable to look at the manual for
  18. that compiler.  In the particular case of VMS C, which is not ANSI C but
  19. a DEC-enhanced version of "classic" C, either version of K&R will
  20. mislead you on many points of libraries.  For instance, if you want
  21. to write a normal text file, you must specify _four_ arguments to fopen:
  22.    fileptr = fopen(filename, "w", "rat=cr", "rfm=var");
  23. You won't find that in K&R.
  24.  
  25. -- 
  26. Stan Brown, Oak Road Systems                      brown@Ncoast.ORG
  27. Cleveland, Ohio, USA
  28. "Only the futility of the first flood prevents God from unleashing another."
  29.             --Chamfort, as quoted in Claude Arnaud's {Chamfort: A Biography}
  30.