home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!gatech!usenet.ins.cwru.edu!agate!boulder!csn!evolving.com!judy
- From: judy@evolving.com (Judy Bettinger)
- Newsgroups: comp.os.msdos.programmer,comp.windows.ms.programmer
- Subject: Trouble with I/O commit()
- Summary: low-level I/O not writing directly to disk
- Message-ID: <1993Jan07.194311.2147@evolving.com>
- Date: 7 Jan 93 19:43:11 GMT
- Organization: Evolving Systems, Inc.
- Lines: 35
-
-
-
- Does anyone now of a way to force the low-level C write() function to flush
- the buffer to the disk? A call to commit() isn't doing anything.
-
- Details:
-
- Our environment is Windows 3.1 running under MS-DOS 5.0 and we're using
- Microsoft C 7.00. The routine we're trying to write just runs in a DOS
- window. The write() call is embedded in a database package
- called CBase, but we do have the source -- that's how I've been able
- to experiment with it. I've been testing by running the process that
- does the writing in a Codeview window and just doing 'type' from another
- DOS window.
-
- What we've tried so far:
-
- First, we checked to see if good 'ol stream I/O (fopen, etc.) would
- successfully do an fflush(). We finally discovered (no thanks to the
- Microsoft support line) , that we needed to call fopen with
- the "c" option and bind in commode.obj. No problem, stream I/O will now
- flush properly. However, when we switch back to cbase, which uses the low-
- level routines, we don't see anything written out until we close the file.
- We've tried not running smartdrv and I added a call to commit() to the
- write routine, but no luck.
-
- I had thought that the low-level routines didn't buffer in the first place,
- but it 'pears I was mistaken.
-
- Anybody got any ideas?
- --
- #include <std_disclaimer.h>
- Judy Bettinger (judy@evolving.com)
- Evolving Systems, Inc.
- Denver, Colorado
-