Title: | DIGITAL UNIX (FORMERLY KNOWN AS DEC OSF/1) |
Notice: | Welcome to the Digital UNIX Conference |
Moderator: | SMURF::DENHAM |
Created: | Thu Mar 16 1995 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 10068 |
Total number of notes: | 35879 |
Hi, I tried fsync on a file opened by fopen for write: fsync(fileno(f)). It seems that it does not update disk storage (at least over nfs). Is it an expected behavior on V4.0 386 (no idea what letter is assigned to this version)? The nfs-mounted disk is served by a 3.2D machine. I have had no problem since i updated my stuff to use of file descriptors (creat). I just want to find out what was happening. (In any case, sync() works as expected.) Any comment? >> Serge
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
9720.1 | SSDEVO::ROLLOW | Dr. File System's Home for Wayward Inodes. | Tue May 06 1997 05:00 | 6 | |
Things which write file pointers, write their data to a buffer managed by the stdio library. When the buffer is full, a write(2) system is call is made. Fsync has no knowledge of the stdio buffer, only the state of the buffer cache. You want to do an fflush() first to force the data to the cache, and then use fsync to flush to disk. | |||||
9720.2 | Oops. | CADSYS::BOGDANOV | Tue May 06 1997 09:56 | 4 | |
Thanks. It hit me this morning that I forgot to flush the buffer. >> Serge |