> Isaac,
>    Thank worked perfectly!  Thanks a million.

Really, no debugging? Wow... It's funny, 'cause that's the 2nd time I've
hand-coded a response on the spot like that using a conditional loop on an
array... I really ought to put that thing in a snippet somewhere. :) Or post
it to my site and give people the url. :)

Isaac
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

> Brett

> ----- Original Message -----
> From: "S. Isaac Dealey" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, September 05, 2002 8:55 AM
> Subject: Re: Disk Space Usage?


>> > Does anyone know how to determine the actual disk space
>> > usage of a folder including all sub folders and files
>> > in
>> > that root folder?  For example if I have a folder
>> > C:\temp\
>> > and I would like to tell a total how much disk space
>> > that
>> > folder is actual using.  Using <cfdirectory I can tell
>> > the
>> > size of each file listed in a folder but I don't know
>> > how
>> > to determine the entire folder usage.  Below is what I
>> > am
>> > currently doing that displays the files and folders and
>> > shows the root file usage.  Any help would be greatly
>> > appreciated.
>>
>> Hi Bret... You can use #ArraySum(MyDirectory["size"])# on
>> your cfdirectory
>> query to get the total size of all files in a given
>> directory. To get the
>> sume for all files in a directory and subdirectories, you
>> need to drill
> down
>> some...
>>
>> <cfset x = 1>
>> <cfset diskusage = 0>
>> <cfset darray = ArrayNew(1)>
>> <cfset darray[1] = "C:\temp">
>>
>> <cfloop condition="x lte arraylen(darray)">
>> <cfdirectory action="list" name="rsdir"
>> directory="#darray[x]#">
>> <cfset diskusage = diskusage + arraySum(rsdir["size"])>
>> <cfloop query="rsdir">
>> <cfif rsdir.type is "dir" and not
>> listfind(".,..",rsdir.name)>
>> <cfset temp =
>> ArrayAppend(darray,"#darray[x]#\#rsdir.name#")></cfif>
>> </cfloop>
>> <cfset x = x + 1>
>> </cfloop>
>>
>> <cfoutput>#diskusage#</cfoutput>
>>
>>
>> hth
>>
>>
>> Isaac
>> Certified Advanced ColdFusion 5 Developer
>>
>> www.turnkey.to
>> 954-776-0046
>>
>>
>> ---------------------------------------------------------
>> ----------------
>> This email server is running an evaluation copy of the
>> MailShield anti-
>> spam software. Please contact your email administrator if
>> you have any
>> questions about this message. MailShield product info:
>> www.mailshield.com
>>
>> -----------------------------------------------
>> To post, send email to [EMAIL PROTECTED]
>> To subscribe / unsubscribe: http://www.dfwcfug.org
>>


> ----------------------------------------------------------
> ---------------
> This email server is running an evaluation copy of the
> MailShield anti-
> spam software. Please contact your email administrator if
> you have any
> questions about this message. MailShield product info:
> www.mailshield.com

> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org




-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to