Created
December 30, 2013 22:18
-
-
Save richardhughes260/8189211 to your computer and use it in GitHub Desktop.
directoryList Fun :(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| directory='c:/cachedMessages'; | |
| variables.dirList=DirectoryList(directory,false,'query','*.eml','desc:DATELASTMODIFIED'); | |
| myQuery = new Query(); // new query object | |
| myQuery.setDBType("query"); | |
| myQuery.setAttributes(sourceQuery=variables.dirList); | |
| myQuery.setAttributes(maxRows=1); | |
| myQuery.setSQL(" select * from sourceQuery order by DATELASTMODIFIED desc"); //set query | |
| qryRes = myQuery.execute(); // execute query | |
| </cfscript> | |
| <cfquery name="qrydirListPrime" dbtype="query" maxrows="1"> | |
| select * | |
| from dirlist | |
| order by DATELASTMODIFIED desc | |
| </cfquery> | |
| <cfdirectory action="list" directory="#directory#" filter="*.eml" name="cfDirectory" sort="datelastmodified desc"> | |
| <cfdump var="#variables#"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment