For some reason the code below lists the last file in the listing as a
directory even though it is a file?
Try it out. Make sure you have some text files in your root directory.
<cfparam name="dir" default="d:\">
<cfoutput>
<CFDIRECTORY ACTION="LIST" DIRECTORY="#dir#" NAME="test">
<cfset testCount = 0>
<cfloop query="test">
<cfset temp = ValueList(test.name)>
<cfif type eq "Dir">
<cfset testCount = testCount + 1>
Count: [#test.type#][#testCount#]<br>
</cfif>
</cfloop>
ListFirst: [#test.type#]#ListFirst(temp)#<br>
ListLast: [#test.type#]#ListLast(temp)#
</cfoutput>
This is my output:
Count: [Dir][1]
Count: [Dir][2]
Count: [Dir][3]
Count: [Dir][4]
Count: [Dir][5]
Count: [Dir][6]
Count: [Dir][7]
Count: [Dir][8]
ListFirst:[Dir] books
ListLast: [Dir] filename.txt
Note the file type on the ListLast output??
It *should* read LstLast: [File] filename.txt
What am I doing wrong?
-------------------------------------------------------------------------
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