findfile.php 679 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /** @file findfile.php
  3. * @brief Program Find a specific file by name.
  4. * @ingroup Examples
  5. * @author Marcus Boerger
  6. * @date 2003 - 2005
  7. *
  8. * Usage: php findfile.php \<path\> \<name\>
  9. *
  10. * \<path\> Path to search in. You can specify multiple paths by separating
  11. * them with ';'.
  12. * \<name\> Filename to look for.
  13. */
  14. if ($argc < 3) {
  15. echo <<<EOF
  16. Usage: php findfile.php <path> <name>
  17. Find a specific file by name.
  18. <path> Path to search in.
  19. <name> Filename to look for.
  20. EOF;
  21. exit(1);
  22. }
  23. if (!class_exists("FindFile", false)) require_once("findfile.inc");
  24. foreach(new FindFile($argv[1], $argv[2]) as $file) echo $file->getPathname()."\n";
  25. ?>