Well the cfdirectory tag works similarly to cfquery, in that it returns a set of 
query-type records and you can specify fields by which to sort. So try using 
cfdirectory to list files filtered by *.csv or FILENAME*.csv. And also specify 
sort="name DESC". This is assuming that the FILENAME part of your csv file names is 
always the same.

This will return your csv files, ordered descending by the file name, and I think by 
the way you describe the file name format, the one with the most recent date/time will 
be the first record. So you can get the file name by queryname.name[1] where queryname 
is the value of the name attribute for the cfdirectory tag.

HTH
Mike Mertsock
Alfred University Web Team

>I'm trying to find a particular file in a directory that has a file name
>similar to 'FILENAME20030803034545.csv'.
>
>I'm trying to use FileExists() but I keep running issues with the time, not
>so much the date....How do I look for a file that has the most recent date
>and time.  Is there an efficient way to find this out?
>
>Thanks,
>
>Matt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to