writeFile: close the file on error
drwxr-xr-x - libraries