[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
close()                  Close File

 #include <io.h>                         Required for declarations only

 int        close(handle);
 int        handle;                      Handle referring to open file

    close() closes the file associated with handle.

    Returns:    Zero if successfully closed, or-1 if an invalid file
                handle was given (in which case errno is set to EBADF).


  -------------------------------- Example ---------------------------------

    This example opens a file for reading and writing, then closes it.

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

         int fhndl;

         main()
         {
               fhndl = open("data",O_RDWR);
               .
               .
               .
               close(fhndl);
          }

See Also: creat() dup() dup2() open() unlink()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson