Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <dos.h>
    unsigned _dos_commit( int handle );

Description:
    The _dos_commit function uses system call 0x68 to flush to disk the DOS
    buffers associated with the file indicated by handle.  It also forces an
    update on the corresponding disk directory and the file allocation
    table.

Returns:
    The _dos_commit function returns zero if successful.  Otherwise, it
    returns a DOS error code and sets  errno to  EBADF indicating an invalid
    file handle.

Example:
    #include <stdio.h>
    #include <dos.h>
    #include <fcntl.h>

    void main()
      {
        int handle;

        if( _dos_open( "file", O_RDONLY, handle ) != 0 ) {
            printf( "Unable to open file\n" );
        } else {
            if( _dos_commit( handle ) == 0 ) {
                printf( "Commit succeeded.\n" );
            }
            _dos_close( handle );
        }
      }

    produces the following:

    Commit succeeded.

Classification:
    DOS

Systems:
    DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32, DOS/PM

See Also:
    _dos_close, _dos_creat, _dos_open, _dos_write

See Also: _dos_close _dos_creat

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson