fclose closes an open file resource, releasing it from memory and any write-locks on the file.
fclose
closes an open file resource, releasing it from memory and any write-locks on the file.
It is a matching function for fopen, after read and writes have been completed. This function will release any write-locks on the file. While often unimportant for batch processes (when a process ends, write-locks are automatically released), it becomes important to release unused resources for long-running applications or background processes.