That is a very elegant piece of code sir. The working example of your idea
is to do that for each directory since cfdirectory only does one directory
at a time. I think I will FW: this to my own cf-talk list so my people can
get a look at it too.
<CFDIRECTORY ACTION="LIST" DIRECTORY="c:\Inetpub\wwwroot" NAME="SpaceAvail">
<cfset diskSpace = ArraySum(ListToArray(ValueList(SpaceAvail.size)))>
<CFOUTPUT>#diskSpace#</CFOUTPUT>
----- Original Message -----
From: "David Shadovitz" <[EMAIL PROTECTED]>
To: "CF-Server" <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 1:54 AM
Subject: RE: [CFDIRECTORY.SIZE]
> Also, you don't need to explicitly loop over the rows of the SpaceAvail
query.
> I haven't tested it, but you should be able to do something like:
> <cfset diskSpace = ArraySum(SpaceAvail.size)>
> or
> <cfset diskSpace = ArraySum(ListToArray(ValueList(SpaceAvail.size)))>
> ....or something like that.
>
> Of course, Jim's points still apply: subdirs are not included, and the tag
> gallery is worth looking at.
>
> -David
>
>
> On Sunday, March 18, 2001 Bryan LaPlante [SMTP:[EMAIL PROTECTED]]
wrote:
> > hey, I think were off to the races. Thanks
> >
> > ----- Original Message -----
> > From: "s@njeevi" <[EMAIL PROTECTED]>
> > To: "CF-Server" <[EMAIL PROTECTED]>
> > Sent: Monday, March 19, 2001 5:22 AM
> > Subject: Re: [CFDIRECTORY.SIZE]
> >
> >
> > > hi
> > > the size there is the size of a file in the directory
c:\inetpub\wwwroot\
> > > so U need to run a loop . this "SpaceAvail" that U have is like a
> > recordset so
> > > U <cfoutput query ="SpaceAvail"> and then iside this have count =
count +
> > > SpaceAvail.size </cfoutput> and the outside the cfoutput access the
value
> > of
> > > count and indicates the size of the folder U specified.
> > >
> > > hope it helps
> > > bye
> > > rever if any questions/clarifications
> > >
> > > "Bryan LaPlante" <[EMAIL PROTECTED]> wrote:
> > > > Hey gang,
> > > > Is there any way to get cfdirectory to return the size of a
direcotry. I
> > > > have tried it in a recursive loop as well as the code below. It
always
> > > > returns 0. Any idea's?
> > > >
> > > >
> > > > <CFDIRECTORY ACTION="LIST"
> > > > DIRECTORY="c:\inetpub\wwwroot"
> > > > NAME="SpaceAvail">
> > > >
> > > > <CFSET diskSpace = spaceAvail.size>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com