The name unlink refers to the process of unlinking/removing a file from the file system's file table so that the contents become detached from any reference to them - they are unlinked. Unlink visuals in duplicated page Asked 2 years, 10 months ago Modified 2 years, 10 months ago Viewed 2k times On Windows when git complains about not being able to "unlink" a file, it's usually caused by another program holding the lock on the file preventing any other write access. Try stop the web server service, and close any other application you think might be related to these files.

Understanding the Context

Unlink of file Failed. Should I try again? Asked 15 years, 4 months ago Modified 11 months ago Viewed 606k times I'm trying to use PHP unlink() function to delete away the specific document in the folder. That particular folder has already been assigned to full rights to the IIS user.

Key Insights

I have a number of files in a folder. I want to delete each file once it has been processed. What's the difference between using os.remove() and os.unlink? Which method is ideal for my scenario? The reason is unlink is smarter than del.

Final Thoughts

UNLINK is a smart command: it calculates the deallocation cost of an object, and if it is very small it will just do what DEL is supposed to do and free the object ASAP. The unlink call probably returns false, because the output is "11" and not "111". So my gut says, it must be a file permissions issue. Are you sure the web user has permission to remove the file? Can you show us the folder permissions, for instance by running ls -la on the command line and pasting the output?