Each directory has at least the . and .. folders, so it is never empty, 
.. so your CFELSE is never executed

-----Original Message-----
From: Robert Obreczarek [mailto:[EMAIL PROTECTED]]
Sent: dinsdag 26 februari 2002 7:44
To: CF-Talk
Subject: cfdirectory prob


Hey gang,

Here's a piece of code I'm working on. Something does not make sense to 
me.
The code work's fine in terms of displaying the directory structure of 
the
folder. The funny part is that if there are no folders in the directory
cfelse does not kick in. Any pointers where my error lies?

<cfdirectory directory="#request.file_path#media\assets\" 
action="list"
name="dirlist">

<cfset temp=ValueList(dirlist.name, ",")>

<cfif ListLen(temp, ",") NEQ 0>
        <cfoutput>
        <cfloop from="1" to=#ListLen(temp)# index="abc">

                <cfset found=ListContains(temp, ".")>
                <cfif found GT 0>
                        <cfset temp=ListDeleteAt(temp, found, ",")>
                </cfif>

                <cfset found=ListContains(temp, "..")>
                <cfif found GT 0>
                        <cfset temp=ListDeleteAt(temp, found, ",")>
                </cfif>

                <cfset found=ListContains(temp, ".cfm")>
                <cfif found GT 0>
                        <cfset temp=ListDeleteAt(temp, found, ",")>
                </cfif>
                <cfset temp=ListSort(temp, "Text")>
        </cfloop>
        <cfloop list="#temp#" index="dirname">
                <a
href="#GetDirectoryFromPath(GetTemplatePath())##dirname#">#dirname#</a>
<br>
        </cfloop>
        </cfoutput>
<cfelse>
        There are no folders available
</cfif>
<cfoutput>
#ListLen(temp, ",")#
</cfoutput>



______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to