Hello,
This is my first post as I am fairly new to ColdFusion. I am using ColdFusionMX
7.1 on Ubuntu and apache 2.2.

What I am trying to do with the if statement is to identify if there is a file
in the directory and if it is, to delete it if it is older than 15 minutes. The
code is running on a loop which is performing on an array. As far as I know the
loop is working good so far but at this point the debugger is giving me:

"The value "InGrrdf.dateLastModified" could not be converted to a date."
beaware that InGrrdf is the first file that the loop should found
(#aMyUrls[3][i]#) 

This is the problematic code:

<cfdirectory action="list" directory="#GetDirectoryFromPath(SavePath)#"
name="#aMyUrls[3][i]#" filter="#aMyUrls[2][i]#">

<cfset MyRecordCount="#aMyUrls[3][i]#.RecordCount">
<cfset MyDateLastModified="#aMyUrls[3][i]#.dateLastModified">

<cfif #MyRecordCount# IS NOT 0 and DateCompare(#MyDateLastModified#,
DateAdd("n", -15, Now())) eq -1>
 <cffile action="delete" file="#SavePath#">
</cfif>


Thanx in advance for you answers
Ioannis


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:258765
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