home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sun-barr!sh.wide!wnoc-tyo-news!sranha!anprda!akira
- From: akira@atson.asahi-np.co.jp (Akira Takiguchi)
- Newsgroups: comp.os.vms
- Subject: Re: flushing in VAXC and DECC
- Message-ID: <3084@anprda.atson.asahi-np.co.jp>
- Date: 27 Dec 92 11:37:49 GMT
- References: <6813@npri6.npri.com> <1992Dec27.055031.24162@eco.twg.com> <1hjtr9INN34t@gap.caltech.edu>
- Organization: ATSON, Inc. (a subsidiary of the Asahi Shimbun)
- Lines: 30
-
- In article <1hjtr9INN34t@gap.caltech.edu> carl@SOL1.GPS.CALTECH.EDU writes:
- >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.
-
- I don't see any reason why anyone is forced to "believe" that standard
- I/O and UNIX I/O are interchangable (is there any explicit documentaion in
- the VAXC manual? I guess no). Yes, fileno() can convert file pointer
- to file descriptor. But that doesn't mean you can mix up standard I/O
- functions and UNIX I/O functions. If you are likely to believe that
- fsync(fileno(stdout)) without preceding fflush() will work, wouldn't you
- also assume that
-
- fp=fopen("test.dat","w");fputs("aaa\n",fp);close(fileno(fp));
- fp=fopen("test.dat","w");fputs("aaa\n",fp);fclose(fp);
-
- do the same? (on VMS, they do - unfortunately. But NEVER on Unix boxes).
-
- Fsync takes a file descriptor as argument, which means it's a UNIX I/O
- function (fsync has long been on unix boxes - BSD origin, I think). Anybody
- who use UNIX I/O function in his program are supposed to know that you need
- special care to use it with standard I/O functions. I wouldn't blame AXP's
- documentation.
- --
- Akira Takiguchi at ATSON, Inc. (a subsidiary of the Asahi Shimbun)
- WAKO GINZA bldg. 8-10-4 Ginza Chuo-ku Tokyo 104 Japan
- +81 3 3289 7051(voice) 7066(fax) EMAIL TO <akira@atson.asahi-np.co.jp>
-