What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Another PHP Help Thread (Getting size of folders)

Another PHP Help Thread (Getting size of folders)
Author: Message:
Ash_
Senior Member
****

Avatar

Posts: 638
Reputation: 31
35 / Male / –
Joined: Aug 2004
O.P. Another PHP Help Thread (Getting size of folders)
ok, i been mucking around with php for a while for school.
i've attempted to write a function that gets the size of folders.

can someone tell me whats wrong with it. i know calling the same function i am in is dodgy but i cant think of another way unless i copy the function again with a different name..

this current code doesent work ><

code:
<?
function foldersize ($folder){
$handle = opendir($folder);
if ($handle = opendir($folder)) {
   while (false !== ($file = readdir($handle))) {
    if($file !='.' && $file !='' && $file != '../'){
            if (is_dir($folder.'/'.$file)){
            $temp2 = $temp2 . "$folder/$file";
            $foldersize = $foldersize + foldersize("$folder/$file");
            }else{
            $temp = $temp . "<b>File</b>: $folder/$file<br>";
$foldersize = $foldersize + filesize("$folder/$file");
}
}
}
}
closedir($handle);
clearstatcache();
$foldersize = truesize($foldersize);
//echo $temp;
//echo "$temp2 <br>";
return $foldersize;
}
?>
[Image: jeansiger5.jpg]
01-31-2005 06:32 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Another PHP Help Thread (Getting size of folders) - by Ash_ on 01-31-2005 at 06:32 AM
RE: Another PHP Help Thread (Getting size of folders) - by WDZ on 01-31-2005 at 06:41 AM
RE: Another PHP Help Thread (Getting size of folders) - by Ash_ on 01-31-2005 at 06:45 AM
RE: Another PHP Help Thread (Getting size of folders) - by -dt- on 01-31-2005 at 06:48 AM
RE: Another PHP Help Thread (Getting size of folders) - by WDZ on 01-31-2005 at 06:48 AM
RE: Another PHP Help Thread (Getting size of folders) - by L. Coyote on 01-31-2005 at 06:49 AM
RE: Another PHP Help Thread (Getting size of folders) - by WDZ on 01-31-2005 at 06:56 AM
RE: Another PHP Help Thread (Getting size of folders) - by Ash_ on 01-31-2005 at 07:12 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On