This tag is a working replacement for <CFDIRECTORY ACTION="list" ... >
The results returned by CFDIRECTORY are far from being complete and useful:
- CF 5 used to return all attributes, like Hidden, Archive, and ReadOnly, in a string, but starting with CFMX, we only get ONE attribute, even if a file has all of them, and apparently, starting with CFMX the archive status is not returned anymore;
- The mode column would be useful information, even if formated à la Unix, but it is always returned empty on Windows systems;
- And last, but not least, the date returned in the dateLastModified is formated quite differently under different versions of ColdFusion, depending on local settings, which makes it practically unusable for any application. For example, for the same file, for three different versions of CF, we get:
- CF 5: 05/23/2001 04:29:10 PM
- CF 6: mercredi 23 mai 2001 17 h 29 EDT
- CF 7: 01-05-23 17:29
- Only CF 5 gives an accurate date including seconds, but this detail is lost with CFMX.
- Only CF 7.0.2 gives a date formated in some sortable format, but since it is the ISO format, and since CF always tries to interpret a date as an American date by default, this can still lead to nasty bugs in many applications.
CFX_ListDir is an attempt to fix these flaws, and to give more accurate and detailed information, in a consistent way under any CF version (It was not tested for CF 4, but there is no reason it should not work as well).
The main feature in CFX_ListDir are:
- All file attributes are returned in independant columns and in yes/no format
- All three available dates about files are returned, ie. dateLastModified, but also dateCreated and dateLastAccess as well;
- The filter attribute is still used, for compatibility with CFDIRECTORY, but a more handy list of file extensions can also be used for file selection;
- More tools for file selection, like Modified Before, Modified After dates, or values of file status like Archive, ReadOnly, etc.
|