Skip to content

Fixing "Cannot remove ...: Permission denied" in File and bundle:: task #547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

ProgerXP
Copy link

Signed-off-by: Pavel proger.xp@gmail.com

Previously described in #538:

Setup: Windows XP SP3, XAMPP with PHP 5.3.

Problem: File::rmdir(), File::cleandir(), Laravel\CLI\Tasks\Bundle\Providers\Provider::zipball() fail to remove directories even though they have successfully emptied them (zipball() fails to remove the temporary zip file).

Cause: FilesystemIterator (File) and ZipArchive (Provider) are locking the directory/zipfile so that the following rmdir()/unlink() fails.

I'm not sure thought that the GC will 100% reliably be triggered after the FilesystemIterator is unset so there might be a room for improvements (e.g. using scandir() instead).

Also, unlike other FIle functions cpdir() doesn't use @ silencer on its rmdir(). Is this intended?

…le:: CLI task.

Signed-off-by: Pavel <proger.xp@gmail.com>
@taylorotwell
Copy link
Member

Nice fix! Would you mind sending this pull request on the develop branch?

@ProgerXP
Copy link
Author

Sure.

@ProgerXP ProgerXP closed this Apr 19, 2012
zoe-edwards pushed a commit to zoe-edwards/laravel that referenced this pull request Oct 14, 2013
flap152 pushed a commit to flap152/laravel that referenced this pull request Nov 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants