Welcome! Log In Create A New Profile

Advanced

Directory Size

Posted by Paulo Oliveira 
Paulo Oliveira
Directory Size
June 29, 2009 08:27PM
Is there any way to know the size of one directory ?

FSIZE only returns the size of one file.

I can list all the files and sum the size of each one but it takes a lot of time to run.

Thanks
Al
Re: Directory Size
June 29, 2009 10:14PM
Hello Paulo

The FDirSize() function will give you what you need but according to the help it also can take awhile to process. I would assume that all these operations are dependant on calls to standard OS services.

Regards
Al
Paulo Oliveira
Re: Directory Size
June 30, 2009 11:26AM
Thanks but i can't find out FDIRSIZE in version XI
Al
Re: Directory Size
June 30, 2009 11:55AM
Hello Paulo

You are right, I just checked and it it is a new feature in V12. Looks like your current method is the best available in V11.

Regards
Al
Peter vV
Re: Directory Size
June 30, 2009 01:22PM
Paolo,

FilesystemObject script
fso is Automation "Scripting.FileSystemObject"
fldr is Automation dynamic
fldr=fso>>GetFolder("c:\temp")
Info(fldr>>Size)
delete fldr
or WMI

Both also can take some time, depending on foldersize

--
Peter



Paulo Oliveira
Re: Directory Size (THANKS)
June 30, 2009 01:55PM
It works and it's faster than my previous code.

Peter: Can you post how to do it with WMI?
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: