Try

isDirectory()

Example

<cfset java_io_File = CreateObject("java", "java.io.File
").init("C:/CFusionMX7/runtime/lib/cfusion.jar")>

<cfset listFiles = java_io_File.listFiles()>

<cfloop from="1" to="#arraylen(java_io_File.listFiles())#" index="x">
<cfoutput>#listFiles[x].getName()#
#listFiles[x].isDirectory()#</cfoutput><br>

<cfif listFiles[x].isDirectory()>

<cfset foundin_counter = foundin_counter + 1>

   <cfset foundinArray[foundin_counter] = listFiles[x].getCanonicalPath()>

</cfif>
</cfloop>



On 9/8/06, Mary Jo Sminkey <[EMAIL PROTECTED]> wrote:
>
> > >The java directory stuff might work quite well in this case.  Yes,
> > you
> > >can tell it to only grab directories, and so long as you don't need
> > >file sizes and whatnot, it should be TONs faster than a cfdirectory
> > >call... theoretically...
>
> I went ahead and coded this so it would be available for those that can
> use it and wow, what a difference in speed! A directory of several thousand
> files is now displaying in just a second or two versus over a minute with
> cfdirectory. But I still didn't find a way to grab just the subdirectory
> names. The list() method gets both files and directories, and while there is
> a listFiles() method, there doesn't seem to be anything corresponding for
> directories. So how do you tell it to only grab directories?
>
> --------------------
> Mary Jo Sminkey
> http://www.cfwebstore.com
> CFWebstore, ColdFusion E-commerce
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:252586
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to