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 occupied files. Is there any good way to do this? Thank you ------ solution ------------------ killing the process that occupies it is not a strong point of php ------ solution -------------------- there is no good solution, only in this way. If it cannot be deleted, stop other programs and then delete them. ------ Could you tell me how to forcibly delete the locked files occupied 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.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.