I have the following code to list all files (in the direct folder and sub folders).
$imagesDir = '../Stock_Images';
$di = new RecursiveDirectoryIterator($imagesDir);
foreach (new RecursiveIteratorIterator($di) as $filename => $file)
{
echo $file->getPathname() . '<br/>';
}
The problem is that I have 2 files named ".apdisk" and ".DS_Store".
The script list both of the files and then stops like there's a bug or something.
I deleted one of the files and then it worked as it should....
Any idea why it happens and how to fix that?
Thanks
EDIT:
I also had FOLDER named ".TemporaryItems" < dont ask me why.
It was the problem >
Caught exception: RecursiveDirectoryIterator::__construct(../Stock_Images/.TemporaryItems/folders.501): failed to open dir: Permission denied
just deleted that folder and it fixed the problem.