home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19920 < prev    next >
Encoding:
Text File  |  1992-12-27  |  3.0 KB  |  85 lines

  1. Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: flushing in VAXC and DECC
  5. Date: 27 Dec 1992 09:43:05 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 71
  8. Distribution: world
  9. Message-ID: <1hjtr9INN34t@gap.caltech.edu>
  10. References: <1992Dec26.211521.4768@spcvxb.spc.edu> <6813@npri6.npri.com>,<1992Dec27.055031.24162@eco.twg.com>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <1992Dec27.055031.24162@eco.twg.com>, larry@eco.twg.com (Lawrence B. Henry III) writes:
  15. >Not to be one to continue scrary precidents.. [ I for one read this group
  16. >for the grin factor associated with the flames posted by marginally informed
  17. >individuals posing as gurus.. directed towards people they feel are unworthy..
  18. >;-) its almost like watching the UN in action..] but I figure in the spirit
  19. >of Christmas and all.. if we are really going to post "real", "live" 
  20. >information...I can add that it is even documented in the online help on 
  21. >AXP machines.. (see below)
  22. >
  23. >
  24. >CC
  25. >
  26. >  Run-time_functions
  27. >
  28. >    fsync
  29. >
  30. >       Flushes data all the way to the disk.
  31. >
  32. >       Syntax:
  33. >
  34. >            #include <stdio.h>
  35. >
  36. >            int fsync(int file_descriptor);
  37. >
  38. >
  39. >CC Run-time_functions Subtopic?
  40. >
  41. >              
  42. >-Larry.
  43. >
  44. >PS. Don't take this serious unless you are one of those people out there posing
  45. >as a guru.. :-)
  46.  
  47. Glad to know that it's documented on AXP machines.  Now, perhaps you'd clarify
  48. a point for us:  The AXP documentation doesn't agree with what fsync() acutally
  49. does under VMS 5.4-2.  In particular, the AXP documentation would have us
  50. believe that:
  51.     fsync(fileno(stdout));
  52. actually causes the results of, e.g., all printf's to be flushed to disk.
  53. Now, under VMS 5.4-2, if you spawn a subprocess (using the command
  54. "SPAWN/NOWAIT/OUTPUT=file_name RUN program" that runs the program
  55.     #include stdio
  56.     main()
  57.     {    printf("This is a test.");
  58.         fsync(fileno(stdout));
  59.         sleep(30);
  60.     }
  61. guess what?  You don't see "This is a test." in the output until the process
  62. dies.  However, if the program had been:
  63.     #include stdio
  64.     main()
  65.     {    printf("This is a test.");
  66.         fflush(stdout);
  67.         fsync(fileno(stdout));
  68.         sleep(30);
  69.     }
  70. you'd see "This is a test." in the output file right away.
  71.  
  72. So, as someone "posing as a guru," I'd like to know whether the function does
  73. as it's documented to do, or whether it does what it does under VMS v5.4-2.
  74.  
  75. (If you don't understand the distinction, that's OK;  You're not "posing as a
  76. guru")
  77. --------------------------------------------------------------------------------
  78. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  79.  
  80. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  81. understanding of astronomy is purely at the amateur level (or below).  So
  82. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  83. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  84. hold me responsible for it, but my organization had nothing to do with it.
  85.