Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>close() close file</b> http://www.X-Hacker.org [<<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 the specified handle.

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

 Portability:   Not supported by ANSI standard.

   -------------------------------- 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: chsize() creat() dup() dup2() open() unlink()

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