|
Creating an MS Dos style text file directory listing - invoked with cfexecute |
I have had a need in the past to list directory contents, and filter on the extension type within that directory.
You can do this using cfdirectory, but you can also use cfexecute to run a batch file, which in my experience is a quicker solution than having coldfusion reading large directories.
Create a batch file like this:
"\yourdir\*.*" is optional you can filter this by file type by adding a file extension. EG \ or \*.log or \logs\*.*
"dir.txt" is the filename you want the listing to be stored in, choice of name/location is up to you. You can write it out to any directory that the server has permissions on.
eg mylogs.dat or \mylogs\list.txt