close()- system call. It will close the file descriptor in the kernel, but will not free the pointer and FILE resources in libc. Instead, you should use fclose () in the FILE pointer, which will also take care of closing the file descriptor.
source
share