Bug #54256 [Com]: DirectoryIterator isn't iterable with a foreach
Edit report at https://bugs.php.net/bug.php?id=54256&edit=1
ID: 54256
Comment by: xpundel at gmail dot com
Reported by: gege2061 at homecomputing dot fr
Summary: DirectoryIterator isn't iterable with a foreach
Status: No Feedback
Type: Bug
Package: SPL related
Operating System: Debian unstable
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Debian under parallels on MacOS.
The same problem: DirectoryIterator return nothing on mounted shared filders
foreach (new DirectoryIterator('/media/psf/Web/') as $fileInfo)
{
echo $fileInfo->getFilename() . "<br>\n";
}
Previous Comments:
------------------------------------------------------------------------
[2013-11-11 21:34:22] andergmartins at gmail dot com
I have the same issue, but using Parallels on a OS X.
I'm running a virtualized Debian 7, PHP 5.4.4-14+deb7u5 as my dev server.
The volume is mounted as a Parallels shared folder, in /media/psf/...
I have tested this script:
-----------------
<?php
$iterador = new RecursiveDirectoryIterator( __DIR__ . '/t1/');
foreach ($iterador as $file)
{
var_dump($file);
}
-----------------
If the script is inside the shared folder, the result is a blank page.
If I execute the script in a not shared folder, a native linux path, it shows an iterator for each
dir content.
------------------------------------------------------------------------
[2013-02-18 00:34:45] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
------------------------------------------------------------------------
[2012-10-26 19:34:33] maurice dot k at zend dot com
The same problem occurs with Parallels Workstation under Windows 7, when using
shared folders. DirectoryIterator is not iteratable using foreach.
Windows 7
Parallels Workstation v6
Linux Ubuntu 12.04.1-LTS
Any suggested workaround?
------------------------------------------------------------------------
[2011-09-23 07:01:25] sniper dot unreal at web dot de
Hi Everyone,
I had the same problem on ubuntu (which is also debian based).
After installing the VirtualBox guest additions that are on the ISO that comes with VirtualBox
instead of the guest additions bundled with debian/ubuntu solved the issue.
So you just have do install the guest additions on your VM and it should work fine.
------------------------------------------------------------------------
[2011-03-17 10:26:03] gege2061 at homecomputing dot fr
The problem is reproducible with php5.3-201103170730
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=54256
--
Edit this bug report at https://bugs.php.net/bug.php?id=54256&edit=1
Thread (10 messages)