PDA

View Full Version : fso - directory size


ghell
04-24-2004, 09:10 PM
is there any easy way of getting the total size of a directory? the actuall directory is just an index so it appears as 0, i want the total file size of inside it, but that does not include files inside subdirectorier and files in subdirectories of that... etc

so i was wondering if there was any easy loop for doing this rather than doing it more statically 10 times or whatever (then files can be put 11 directories down and it wont count them so i really dont want this) .. 10 is just an example number

EDIT: this does not have to be a loop, anything will, infact if theres a fso.folder.totalfilesize or somit like that it would prob be beter (you know what i mean .. i hope)

ghell
04-24-2004, 09:43 PM
crap, i hate doing this...

i worked it out by getting an idea off a vb forum, you can use getfolder to do it, eg:
set somit = getfolder("C:\inetpub\wwwroot")
response.write somit.size
set somit = nothing

and now, after i have done this, guess what jsut starting working...

objFsoSubDir.Size

D'OH!