-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
RecursiveDirectoryIterator does not work on NFS #8377
Conversation
Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/ |
This contribution is MIT licensed |
Thanks a lot! |
@owncloud-bot this is ok to test |
💣 Test Failed. 💣 |
@pluijm Can you please have a look at the failing unit tests? Something is not working properly - THX |
At first I couldn't reproduce the error when I used a tmp directory in my home dir. Then I used /tmp and the error occured. Calling rewind() seems to fix the problem. |
🚀 Test Passed. 🚀 |
I'll take it. |
@@ -44,17 +44,21 @@ public function rmdir($path) { | |||
new \RecursiveDirectoryIterator($this->datadir . $path), | |||
\RecursiveIteratorIterator::CHILD_FIRST | |||
); | |||
foreach ($it as $file) { | |||
$it->rewind(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment explaining why foreach (which would be prefered over while) is not used. Make sure to link to the bug ticket in question, i.e. #8376
Patch might be incomplete. There is another match for RecursiveDirectoryIterator in
and
although the last one probably does not have to be changed. |
Code looks good 👍 with some comments about the issue |
🚀 Test Passed. 🚀 |
🚀 Test Passed. 🚀 |
@@ -883,11 +883,19 @@ private static function calculateSize($view) { | |||
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST); | |||
$size = 0; | |||
|
|||
foreach ($iterator as $path) { | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining spaces here apparently.
Looks good otherwise. 👍 |
The inspection completed: 1 new issues |
🚀 Test Passed. 🚀 |
@pluijm has already fixed the requested issues and two thumbs up, tests passed. |
RecursiveDirectoryIterator does not work on NFS
Please see issue #8376