How to Flush File Buffers from within a Basic Program (43267)
The information in this article applies to:
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
This article was previously published under Q43267 SUMMARY
The following information applies to QuickBasic Versions 4.00, 4.00b,
and 4.50, to Microsoft Basic Compiler Versions 6.00 and 6.00b, and to
Microsoft Basic PDS Version 7.00.
Flushing a file buffer to disk from within a Basic program can be done
with one of the following two methods using MS-DOS Interrupt CALLs:
- Using MS-DOS Version 3.30 or later, the MS-DOS Interrupt 21 Hex
with Function 68 Hex commits the file buffer to disk.
- Using MS-DOS earlier than Version 3.30, the MS-DOS Interrupt 21 Hex
with Function 45 Hex creates a duplicate file handle, followed by a
Interrupt 21 Hex with Function 3E Hex to close the duplicate file
handle, which commits the file buffer to disk.
Using Interrupt 21 Hex with Function 68 Hex has the advantage of not
failing due to an insufficient number of file handles, or not risking
losing control of the file in network environments. Its disadvantage
is its limitation to MS-DOS 3.30 or later.
Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
---|
Keywords: | KB43267 |
---|
|