PHP 8.5.0 Alpha 1 available for testing

Voting

: two plus zero?
(Example: nine)

The Note You're Voting On

Anonymous
20 years ago
To get a dirsize recursive you can use this simple function:

<?php # copyright by fackelkind | codeMaster
function getRecDirSize ($connection, $dir){
$temp = ftp_rawlist ($connection, "-alR $dir");
foreach (
$temp as $file){
if (
ereg ("([-d][rwxst-]+).* ([0-9]) ([a-zA-Z0-9]+).* ([a-zA-Z0-9]+).* ([0-9]*) ([a-zA-Z]+[0-9: ]*[0-9]) ([0-9]{2}:[0-9]{2}) (.+)", $file, $regs)){
$isdir = (substr ($regs[1],0,1) == "d");
if (!
$isdir)
$size += $regs[5];
}
}
return
$size;
}
$dirSize = getRecDirSize ($conID, "/");
?>

<< Back to user notes page

To Top