Kamala - Hiperidrose - Internet Advertising - Debt Consolidation - Air Force 1 Shoes

PDA

View Full Version : File Management (CFFILE)


nanosuna
Dec 13th 2006, 3:39 pm
Hi,

I am trying to find out the date when a text file (.txt) was last mofidied on the server (CF server). My application writes to this file which is in a cf server folder and then I need to check that the file is more than 2 days old. Anybody out there knows of an easy way to do this? :)

Thanks,

datropics
Dec 16th 2006, 6:53 pm
<cfdirectory action="list" director="FullPathOfDirectory" filter="FileName" name="DirList">

<cfoutput query="DirList">
<cfif Abs(DateDiff("d",dateLastModified,Now())) GTE 2>
<!--- do something if the dateLastModified is greater than 2 days --->
</cfif>
</cfoutput>

1) <cfdirectory....Get a directory listing of the said folder and only list the said file

2) <cfoutput query....This is for if for some strange reason the file wasn't there. That way if the file isn't there you don't run into problems later down.

3) <cfif ABS(DateDiff.... check to see if the file is more than 2 days old

4) if it is - DO SOMETHING!