That's right. The "type" columns returned in the query resultset from
CFDIRECTORY can have a value of either "File" or "Dir". (Worth noting the
case-sensitivity for some types of comparisons one may do.)

And you could indeed do a loop over the results to subset them. Another
approach in CF 5 is to use Query of Queries to achieve the same result.
Here's an example that finds the subdirectories in the current directory
(uses expandpath(".") to get the directory holding the template being run) :

<CFDIRECTORY ACTION="LIST" DIRECTORY="#expandpath(".")#" NAME="getfiles">

<cfquery DBTYPE="query" NAME="getonlydirs">
        select * from getfiles
        where type = 'Dir'
</cfquery>

<h4>Subdirectories within the current directory:</h4>
<cfoutput query="getonlydirs">
        #name#<br>
</cfoutput>

Again, notice that the type='Dir' is critical. CF 5's query of queries is
case-sensitive, so type="dir" would find nothing.

/charlie

PS This example comes right out of my daylong seminar on CF5. It's just
coincidental that the example I used to demonstrate how QofQ works with ANY
tag producing a resultset happened to be on this subject of subsetting
CFDIRECTORY results. More info at http://www.systemanage.com/CF5inDepth.cfm

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Marc Campeau
Sent: Monday, February 25, 2002 12:02 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFTALKTor] RE:CF Directory


THe Query returned by CFDIRECTORY as a column "Type" which is either file or
dir if I'm not mistaken, Loop on the query displaying only the directories
that way.

Marc

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Shane Von Svoboda
> Sent: Monday, February 25, 2002 11:51 AM
> To: [EMAIL PROTECTED]
> Subject: [CFTALKTor] RE:CF Directory
>
>
>
>
> Hello everyone,
>
> Is there a way to just display directories under a specified path using
> CFDirectory and not the files listed under the specified path? For
> instance I would like to display all the directories available to a user
> so they can choose what folder to upload their image using CFFile. The
> problem I'm running into is that cfDirectory displays all the images
> under the main images root and shows the current and parent directory as
> "." , ".."  respectively. Any hints would be greatly appreciated.
>
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: "Shane Von Svoboda"
> <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED])
> http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
>
>

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Marc Campeau" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "charles arehart" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to