I would like to ask you how to forcibly delete files that are locked by other programs using php.
Source: Internet
Author: User
How can I forcibly delete files that are locked by other programs using php .. unlink cannot be used to delete the occupied files. Is there any good method? thank you. killing the process that occupies him is not a strong point of php. there is no good way. this is the only way. If it cannot be deleted, stop other programs and then delete them ., Permissiondenied permission is insufficient. could you please tell me how to force the deletion of locked files by other programs using php ..
Unlink cannot be used to delete occupied files. Is there any good method? thank you.
------ Solution --------------------
Kill the process that occupies him
This is not the strength of php.
------ Solution --------------------
There is no good way to do this. If it cannot be deleted, stop other programs and then delete them.
------ Solution --------------------
Permission denied has insufficient permissions. use the cli of another root identity to execute unlink.
------ Solution --------------------
I'm wondering why this operation is required.
This should be noted during programming.
If this is unavoidable, you should write an interface for the program that occupies the file to release it.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service