note 25512 added to function.opendir
| From: | luciano_em_BrazilianTranslation dot net at rack1 dot php dot net | Date: | Thu, 26 Sep 2002 09:17:08 +0000 |
| Subject: | note 25512 added to function.opendir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37271@lists.php.net to get a copy of this message | ||
The manual says: "If path is not a valid directory, ... opendir() returns FALSE and generates a
PHP error." But that is not entirely true:
- if you call "opendir ()", ie with no arguments, you get an error;
- if you call "opendir ("/some/bogus/dir")", ie with a non-existing directory as
argument, you get an error;
- but if you call opendir with some bogus/unset variable, ie "opendir ($blahblahblah)",
opendir won't mind at all, and will open the script's current directory.
This is useful in shell scripting, if you want to have the script open its current directory and
always be able to copy/move it around without having to worry about particular argument.
--
http://www.php.net/manual/en/function.opendir.php
http://master.php.net/manage/user-notes.php?action=edit+25512
http://master.php.net/manage/user-notes.php?action=delete+25512
http://master.php.net/manage/user-notes.php?action=reject+25512