home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
- From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
- Newsgroups: comp.os.vms
- Subject: Re: flushing in VAXC and DECC
- Date: 27 Dec 1992 09:43:05 GMT
- Organization: HST Wide Field/Planetary Camera
- Lines: 71
- Distribution: world
- Message-ID: <1hjtr9INN34t@gap.caltech.edu>
- References: <1992Dec26.211521.4768@spcvxb.spc.edu> <6813@npri6.npri.com>,<1992Dec27.055031.24162@eco.twg.com>
- Reply-To: carl@SOL1.GPS.CALTECH.EDU
- NNTP-Posting-Host: sol1.gps.caltech.edu
-
- In article <1992Dec27.055031.24162@eco.twg.com>, larry@eco.twg.com (Lawrence B. Henry III) writes:
- >Not to be one to continue scrary precidents.. [ I for one read this group
- >for the grin factor associated with the flames posted by marginally informed
- >individuals posing as gurus.. directed towards people they feel are unworthy..
- >;-) its almost like watching the UN in action..] but I figure in the spirit
- >of Christmas and all.. if we are really going to post "real", "live"
- >information...I can add that it is even documented in the online help on
- >AXP machines.. (see below)
- >
- >
- >CC
- >
- > Run-time_functions
- >
- > fsync
- >
- > Flushes data all the way to the disk.
- >
- > Syntax:
- >
- > #include <stdio.h>
- >
- > int fsync(int file_descriptor);
- >
- >
- >CC Run-time_functions Subtopic?
- >
- >
- >-Larry.
- >
- >PS. Don't take this serious unless you are one of those people out there posing
- >as a guru.. :-)
-
- Glad to know that it's documented on AXP machines. Now, perhaps you'd clarify
- a point for us: The AXP documentation doesn't agree with what fsync() acutally
- does under VMS 5.4-2. In particular, the AXP documentation would have us
- believe that:
- fsync(fileno(stdout));
- actually causes the results of, e.g., all printf's to be flushed to disk.
- Now, under VMS 5.4-2, if you spawn a subprocess (using the command
- "SPAWN/NOWAIT/OUTPUT=file_name RUN program" that runs the program
- #include stdio
- main()
- { printf("This is a test.");
- fsync(fileno(stdout));
- sleep(30);
- }
- guess what? You don't see "This is a test." in the output until the process
- dies. However, if the program had been:
- #include stdio
- main()
- { printf("This is a test.");
- fflush(stdout);
- fsync(fileno(stdout));
- sleep(30);
- }
- you'd see "This is a test." in the output file right away.
-
- So, as someone "posing as a guru," I'd like to know whether the function does
- as it's documented to do, or whether it does what it does under VMS v5.4-2.
-
- (If you don't understand the distinction, that's OK; You're not "posing as a
- guru")
- --------------------------------------------------------------------------------
- Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
-
- Disclaimer: Hey, I understand VAXen and VMS. That's what I get paid for. My
- understanding of astronomy is purely at the amateur level (or below). So
- unless what I'm saying is directly related to VAX/VMS, don't hold me or my
- organization responsible for it. If it IS related to VAX/VMS, you can try to
- hold me responsible for it, but my organization had nothing to do with it.
-