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 <io.h>
    int _hdopen( int os_handle, int mode );

Description:
    The _hdopen function takes a previously opened operating system file
    handle specified by os_handle and opened with access and sharing
    specified by mode, and creates a POSIX-style file handle.

Returns:
    The _hdopen function returns the new POSIX-style file handle if
    successful.  Otherwise, it returns -1.

See Also:
    close, fdopen, open, _os_handle

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

    void main()
      {
        int dos_handle;
        int handle;
        if( _dos_open( "file", O_RDONLY, &dos_handle ) != 0 ) {
          printf( "Unable to open file\n" );
        } else {
          handle = _hdopen( dos_handle, O_RDONLY );
          if( handle != -1 ) {
            write( handle, "hello\n", 6 );
            close( handle );
          }
        }
      }

Classification:
    WATCOM

Systems:
    All

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