BEAUTIFUL CFDIRECTORY

http://www.forta.com/blog/index.cfm/2006/11/1/improving-cfdirectory-performance

this post is awesome… it’s an undocumented feature that sits in a live doc note on the live docs of coldfusion….

Here is what’s written on Ben’s Blog:

“Mark Kruger posted comments about the performance of (see post 1 and post 2). He noted that returning full directory information with all file details (especially over network connections) can be painfully slow. As per his post, using Java APIs to return directory lists is far quicker, which is odd as actually uses the same Java APIs internally.”

“In a comment on Mark’s blog, Tom Jordahl pointed out that the reason for this is that for to return all file details it needs to first retrieve the file list and then perform a Java stat() for each file, and that stat() call is very time consuming (especially over network connections). The solution, if you just need file names and not other details, is to use the undocumented LISTINFO attribute. LISTINFO defaults to “all”, but specify LISTINFO=”name” and will only return file names and will run just as quickly as the Java APIs it relies on.”

I could use this soooo so much in my directory lister for all of my music…

The only reason I’m blogging this direct copy of Ben’s post because i plan to use it later, and i feel bad just copying bits and pieces, and I’m not sure if I’ll ever be able to find it again… lord only knows how many times i come across code, and code snippets, and good example sites, and a day later i never remember where they were, and i can’t find them any more… gosh that aggravates me

Leave a comment