note 19761 deleted from function.is-dir by jimw
| From: | jimw@php.net | Date: | Thu, 18 Apr 2002 21:28:39 +0000 |
| Subject: | note 19761 deleted from function.is-dir by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-29553@lists.php.net to get a copy of this message | ||
This function does what it is meant to and without the need to chdir, meaning it does work with full
paths. (i.e. /path/dir)
Directory exists = returns true
Directory doesn't exist = returns nothing
Directory is file = returns false
Directory is a symlink to a file = false
Directory is a symlink to a dir = true
What I found is that the most common error was to use is_dir for seeing whether a directory exists
which will return nothing, so it might seem that the fucntion is buggy, but infact it does exactly
what it's meant to. Someone pointed it out before, just use an else statement to catch the
nothing return.