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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <dos.h>
    unsigned _dos_close( int handle );

Description:
    The _dos_close function uses system call 0x3E to close the file
    indicated by handle.  The value for handle is the one returned by a
    function call that created or last opened the file.

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

See Also:
    creat, _dos_creat, _dos_creatnew, _dos_open, dup, fclose, open

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

    void main()
      {
        int handle;

        /* Try to open "stdio.h" and then close it */
        if( _dos_open( "stdio.h", O_RDONLY, &handle ) != 0 ){
          printf( "Unable to open file\n" );
        } else {
          printf( "Open succeeded\n" );
          if( _dos_close( handle ) != 0 ) {
            printf( "Close failed\n" );
          } else {
            printf( "Close succeeded\n" );
          }
        }
      }

Classification:
    DOS

Systems:
    DOS, Win, OS/2 1.x(all), OS/2 2.x, NT, DOS/PM

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