Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/03/2007, 03:48
Avatar de estibaliz2006
estibaliz2006
 
Fecha de Ingreso: noviembre-2006
Mensajes: 439
Antigüedad: 17 años, 5 meses
Puntos: 1
mostrar mensaje si el directorio está vacío

hola a todos. a ver. mediante este código leo los archivos que hay en un directorio:

Código PHP:
$path $_GET['path']; 
   if(!isset(
$path)) 
   { 
       
$path "documentos"
   } 
   if (
$handle opendir($path))  
   { 
       
$curDir substr($path, (strrpos(dirname($path."/."),"/")+1)); 
       print 
"Directorio Actual: ".dirname($path."/.")."<br>************************<br>"

       while (
false !== ($file readdir($handle)))  
       { 
           if (
$file != "." && $file != "..")  
           { 
               
$fName $file
               
$file $path.'/'.$file
               if(
is_file($file)) 
               { 
                   print 
"&nbsp;&nbsp;<a href='".$file."'>".$fName."</a>&nbsp;&nbsp;&nbsp; ".filesize($file)." bytes<br>"
               } 
                
           } 
       } 

       
closedir($handle); 
   } 
lo que yo quiero saber es cómo hacer para que, si el directorio está vacío, me de un mensaje del estilo "actualmente no hay archivos en este directorio" o algo así. alguna ayuda?