note 25338 added to function.opendir

From: Date: Fri, 20 Sep 2002 02:04:18 +0000
Subject: note 25338 added to function.opendir
Groups: php.notes 
Request: Send a blank email to php-notes+get-37008@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 an error." But that is not entirely true. - If you try to use just opendir(), ie without any parameters, you'll get an error; - if you try to use a directory that does not exist, like opendir("/home/false_dir"), you'll get an error; - but if you use a bogus (unset) variable, say, opendir($blahblahblah), opendir will open its script's current directory. May come in handy in shell scripts, if you just want to open the current directory, whatever that is, and always be able to copy/move the script to another place without having to worry about that parameter. Running Windows, PHP 4.2.3. -- http://www.php.net/manual/en/function.opendir.php http://master.php.net/manage/user-notes.php?action=edit+25338 http://master.php.net/manage/user-notes.php?action=delete+25338 http://master.php.net/manage/user-notes.php?action=reject+25338

« previous php.notes (#37008) next »