note 52617 deleted from function.is-file by nlopess

From: Date: Sat, 07 May 2005 07:36:26 +0000
Subject: note 52617 deleted from function.is-file by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-89063@lists.php.net to get a copy of this message
Note Submitter: gesto at speedy dot com dot ar Reason: useless ---- After working several hours with some code I realized that the functions is_dir, is_file, file_exists, doesn't seem to work if those files aren't on the same folder as the code is. ie: <?php if (!isset($dir)){ $dir="."; } $recurso=opendir($dir); while ($archivo=readdir($recurso)){ if (is_dir($archivo)){ echo "el elemento $archivo es un directorio<br>"; } if (is_file($archivo)){ echo "el elemento $archivo es un archivo<br>"; } } closedir($recurso); ?> let's say this code is in folder ./home/, well this code will only work as desired for files inside folder ./home , if i use it to read folder ./home/some it will only read work fine with files that are common to both folders. Wating for any suggestion to my mail listed above...

« previous php.notes (#89063) next »