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 close( int handle );

Description:
    The close function closes a file at the operating system level.  The
    handle value is the file handle returned by a successful execution of
    one of the  creat,  dup,  dup2,  open or  sopen functions.

Returns:
    The close function returns zero if successful.  Otherwise, it returns -1
    and  errno is set to indicate the error.

Errors:
    When an error has occurred,  errno contains a value indicating the type
    of error that has been detected.

    EBADF
        The handle argument is not a valid file handle.


See Also:
    creat, dup, dup2, open, sopen

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

    void main()
      {
        int handle;

        handle = open( "file", O_RDONLY );
        if( handle != -1 ) {
          /* process file */
          close( handle );
        }
      }

Classification:
    POSIX 1003.1

Systems:
    All

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