I want to filter directories and files by what they start with.

var result =  DirectoryList(arguments.path, false, "query", 
   arguments.filter & "*|" & arguments.filter & "*.*");

I am thinking this covers all scenarios because file sometimes don't have extensions and directories sometimes do. I don't think it can be simplier

  • \$\begingroup\$ Please remember to add the cfml tag to your questions. You seem to forget it almost every time. \$\endgroup\$ – Jamal Mar 3 at 2:47
  • 1
    \$\begingroup\$ You could probably remove the second filter, since arguments.filter & "*.*" is already covered by arguments.filter & "*" \$\endgroup\$ – Ageax Apr 18 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.