diff options
| author | SVN Migration <svn@php.net> | 2003-12-19 20:39:05 +0000 |
|---|---|---|
| committer | SVN Migration <svn@php.net> | 2003-12-19 20:39:05 +0000 |
| commit | fc1a9b7558738019cb4276659a851eca10cdea7e (patch) | |
| tree | 330bf7b1b09d7462be9df62ebd5869572386b8b2 /ext/spl/examples/findfile.php | |
| parent | 331dc79254566ee777f6af7be9232f1f647c9474 (diff) | |
| download | php-git-php-5.0.0b3RC2.tar.gz | |
This commit was manufactured by cvs2svn to create tag 'php_5_0_0b3RC2'.php-5.0.0b3RC2
Diffstat (limited to 'ext/spl/examples/findfile.php')
| -rwxr-xr-x | ext/spl/examples/findfile.php | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/ext/spl/examples/findfile.php b/ext/spl/examples/findfile.php deleted file mode 100755 index 5cdd0dc893..0000000000 --- a/ext/spl/examples/findfile.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/** Find a specific file by name. - * - * Usage: php findfile.php <path> <name> - * - * <path> Path to search in. - * <name> Filename to look for. - * - * (c) Marcus Boerger, 2003 - */ - -if ($argc < 3) { - echo <<<EOF -Usage: php findfile.php <file> <name> - -Find a specific file by name. - -<path> Path to search in. -<name> Filename to look for. - - -EOF; - exit(1); -} - -class FindFile extends FilterIterator -{ - protected $file; - - function __construct($path, $file) { - $this->file = $file; - parent::__construct(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path))); - } - function accept() { - return !strcmp($this->it->current(), $this->file); - } -} - -foreach(new FindFile($argv[1], $argv[2]) as $pathname => $file) echo "$pathname\n"; -?>
\ No newline at end of file |
