note 102583 deleted from directoryiterator.construct by danbrown

[email protected] Wed, 23 Feb 2011 07:57:08 -0800
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: flobee 

----

well, using clients it in multiple plattforms standard function are still required!
<?php
$paths = array('/tmp/', 'c:/tmp/');
foreach ($paths as $path) {
foreach (new DirectoryIterator($path) as $file) {
// ...
?>

if you are on *nix systems the windows path 'c:/tmp/' will throw an exception :-/

So check with is_dir() or someting before using it.