FileLastModified(filename)
Last updated June 11, 2009
Version: 1 | Requires: ColdFusion MX | Library: FileSysLib
Description:
Returns the date the file was last modified. The date is adjusted according to timezone. It returns a valid coldfusion date object. It uses the standard Java File object, which makes it very fast under Coldfusion MX
Return Values:
Returns a date.
Example:
<cfoutput>
Length: #FileLastModified(filename)#<br>
</cfoutput>
Parameters:
| Name | Description | Required |
|---|---|---|
| filename | Name of the file. | Yes |
Full UDF Source:
<cfscript>
/**
* Returns the date the file was last modified.
* v2 fixes for DTS by Mark Woods (mwoods@online.ie)
*
* @param filename Name of the file. (Required)
* @return Returns a date.
* @author Jesse Houwing (mwoods@online.iej.houwing@student.utwente.nl)
* @version 1, June 11, 2009
*/
function FileLastModified(filename){
var oFile = createObject("java","java.io.File");
var oDate = createObject("java","java.util.Date");
oFile.init(fileName);
return oDate.init(oFile.lastModified());
}
</cfscript>
Search CFLib.org
Latest Additions
Shawn Porter added
DeMoronize
3 hour(s) ago
Chris Carey added
readPropertiesFi...
1 day(s) ago
Randy Johnson added
lastDayofWeek
3 day(s) ago
Frank Marion added
sitemapPing
7 day(s) ago
Top Rated
QuickSort
Rated 5.0, 3 time(s)
indentXml
Rated 5.0, 3 time(s)
queryColumnsToSt...
Rated 5.0, 3 time(s)
generateSsccAsn
Rated 5.0, 3 time(s)