home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19923 < prev    next >
Encoding:
Internet Message Format  |  1992-12-27  |  2.0 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!sh.wide!wnoc-tyo-news!sranha!anprda!akira
  2. From: akira@atson.asahi-np.co.jp (Akira Takiguchi)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: flushing in VAXC and DECC
  5. Message-ID: <3084@anprda.atson.asahi-np.co.jp>
  6. Date: 27 Dec 92 11:37:49 GMT
  7. References: <6813@npri6.npri.com> <1992Dec27.055031.24162@eco.twg.com> <1hjtr9INN34t@gap.caltech.edu>
  8. Organization: ATSON, Inc. (a subsidiary of the Asahi Shimbun)
  9. Lines: 30
  10.  
  11. In article <1hjtr9INN34t@gap.caltech.edu> carl@SOL1.GPS.CALTECH.EDU writes:
  12. >Glad to know that it's documented on AXP machines.  Now, perhaps you'd clarify
  13. >a point for us:  The AXP documentation doesn't agree with what fsync() acutally
  14. >does under VMS 5.4-2.  In particular, the AXP documentation would have us
  15. >believe that:
  16. >    fsync(fileno(stdout));
  17. >actually causes the results of, e.g., all printf's to be flushed to disk.
  18.  
  19.      I don't see any reason why anyone is forced to "believe" that standard
  20. I/O and UNIX I/O are interchangable (is there any explicit documentaion in
  21. the VAXC manual?  I guess no).  Yes, fileno() can convert file pointer
  22. to file descriptor.  But that doesn't mean you can mix up standard I/O
  23. functions and UNIX I/O functions.  If you are likely to believe that
  24. fsync(fileno(stdout)) without preceding fflush() will work, wouldn't you
  25. also assume that
  26.  
  27.      fp=fopen("test.dat","w");fputs("aaa\n",fp);close(fileno(fp));
  28.      fp=fopen("test.dat","w");fputs("aaa\n",fp);fclose(fp);
  29.  
  30. do the same?  (on VMS, they do - unfortunately.  But NEVER on Unix boxes).
  31.  
  32.      Fsync takes a file descriptor as argument, which means it's a UNIX I/O
  33. function (fsync has long been on unix boxes - BSD origin, I think).  Anybody
  34. who use UNIX I/O function in his program are supposed to know that you need
  35. special care to use it with standard I/O functions.  I wouldn't blame AXP's
  36. documentation.
  37. -- 
  38.        Akira Takiguchi  at ATSON, Inc. (a subsidiary of the Asahi Shimbun)
  39.                    WAKO GINZA bldg.  8-10-4 Ginza Chuo-ku Tokyo 104  Japan
  40.    +81 3 3289 7051(voice) 7066(fax)  EMAIL TO <akira@atson.asahi-np.co.jp>
  41.