php-src/ext/spl/examples/findfile.php
Marcus Boerger e058626c66 Add new iterator example AppendIterator and use it in findfile.php example.
# The initial idea came from a request by Sebastian
2004-04-25 13:06:15 +00:00

29 lines
527 B
PHP
Executable File

<?php
/** Find a specific file by name.
*
* Usage: php findfile.php <path> <name>
*
* <path> Path to search in. You can specify multiple paths by separating
* them with ';'.
* <name> Filename to look for.
*
* (c) Marcus Boerger, 2003 - 2004
*/
if ($argc < 3) {
echo <<<EOF
Usage: php findfile.php <path> <name>
Find a specific file by name.
<path> Path to search in.
<name> Filename to look for.
EOF;
exit(1);
}
foreach(new FindFile($argv[1], $argv[2]) as $file) echo $file->getPathname()."\n";
?>