[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Part1 - Part2 - Part3 - Single Page

Top Document: x86 Assembly Language FAQ - General Part 2/3
Previous Document: 19. ASM Code Available on the Internet
Next Document: 21. Using Extended Memory Manager


20. How to Commit A File


The easiest solution is to open or create the file to be committed using
Int 21h function 6ch, extended open/create.  The BX register contains
the desired Open Mode.  One option that can be or'ed into this register
is what Microsoft calls, OPEN_FLAGS_COMMIT, that has the value of 4000h.
Using this option caused DOS to commit the file after each write.  This
function has been available (documented) since DOS 4.0.

If you do not want to commit the file at each write but only when
certain conditions are met, use Int 21h function 68h, commit file.  The
functions have been available (documented) since DOS 3.3.

If you need to support versions of DOS before 3.3, the following
technique will flush the all stored data without closing and opening the
file.  The time consuming process is the opening of the file.
    1.  Use 21h function 45h to create a duplicate file handle to the
        file to be flushed.
    2.  Close that duplicate file handle.

This technique will work all the way back to DOS 2.0.

Contributor: Raymond Moon, raymoon@moonware.dgsys.com
Last changed: 30 Jan 95



Top Document: x86 Assembly Language FAQ - General Part 2/3
Previous Document: 19. ASM Code Available on the Internet
Next Document: 21. Using Extended Memory Manager

Part1 - Part2 - Part3 - Single Page


[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
raymoon@moonware.dgsys.com

Last Update October 22 2009 @ 05:22 AM

Some parts © 2009 Advameg, Inc.