mov bx, Handle ;handle of file to commit
mov ah, 68h ;Commit File
int 21h
jc error_handler ;carry set means error
Commit File (Function 68h) flushes all stored data for a file without closing the file; this ensures that the contents of the file are current.
Handle
Identifies the file to commit.
If the function is successful, the carry flag is clear. Otherwise, the carry flag is set and the AX register contains an error value.
This function provides a more efficient way to update file contents than closing a file and immediately reopening it. However, if a program opens or creates a file by specifying the flag OPEN_FLAGS_COMMIT (4000h) with Extended Open/Create (Function 6Ch), the system updates the file each time the file is written to.
Function 0Dh Reset Drive
Function 6Ch Extended Open/Create