Shaun Mccran

My digital playground

17
F
E
B
2009

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:

view plain print about
1dir \yourdir\*.* /s/b >dir.txt

"\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

TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Murli's Gravatar The knowledge of the intext file is given on fm radio. The information is collected from http://www.whowritesbest.com/writing-services-disc.... The website is very necessary and essential for the right and intricate analysis and assessment.
# Posted By Murli | 18/01/2016 04:00
Back to top