Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/12/2003, 14:09
Avatar de nuevo
nuevo
 
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 20 años, 11 meses
Puntos: 2
tamaño de carpeta

Código PHP:
/********************************************************************************/
/*           FUNCION PARA SACAR EL TAMAÑO DEL HDD DE UNA CARPETA                */
/********************************************************************************/
function FUNC_sizeCarpeta($dir) {
    
$dh opendir($dir);
    
$size 0;
    while ((
$file readdir($dh)) !== false)
        if (
$file != "." and $file != "..") {
            
$path $dir."/".$file;
            if (
is_dir($path))
                
$size += dirsize($path);
            elseif (
is_file($path))
                
$size += filesize($path);
        }
    
closedir($dh);
    
$size number_format($size/1024,3);
    return 
$size;
}
////////////////////////////////////////////////////////////////////////////////// 
quota de la web

Código PHP:
/********************************************************************************/
/* FUNCION PARA SACAR LA QUOTA DEL HDD DEL SERVIDOR+NUMERO DE FICHEROS/CARPETAS */
/********************************************************************************/
function FUNC_sizeDomainQuota($quota){ //FUNC_sizeDomainQuota($quota=25);

    
function obsah($adr,&$totalquota,&$dir,&$size){

          
$dp OpenDir($adr);

              do{

                
$itm ReadDir($dp);

    if (
Is_Dir("$adr/$itm")&&($itm!=".")&&($itm!="..")&&($itm!="")){

      
obsah("$adr/$itm",$totalquota,$dir,$size);

          
$dir++;
    }

    elseif ((
$itm!=".")&&($itm!="..")&&($itm!="")){

      
$size $size FileSize("$adr/$itm");
      
$totalquota++;
    }

  } while (
$itm!=false);

  
CloseDir($dp);

}

    
obsah(".",$totalquota,$dir,$size);

        
$freeA $size/1024*1024;
        
$freeA $freeA/1024;
        
$freeA $freeA/1024;

        
$exp explode(".",$freeA);
        
$freeN substr($exp[1],0,2);
        
$freeA $exp[0].".".$freeN;

        
$freeB $quota-$freeA;

        
$datosQuote "Tamaño del Portal: <B>$freeA</B> Mbytes - Quota del Portal: <B>$quota</B> Mbytes<br>Espacio Libre: <B>$freeB</B> Mbytes - Ocupado por <B>$totalquota</B> ficheros y <B>$dir</B> carpeta\s";

    return 
$datosQuote;
}
////////////////////////////////////////////////////////////////////////////////// 
__________________
3w.valenciadjs.com
3w.laislatv.com