Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

getting highest numbered filename in directory

New Here ,
Oct 22, 2010 Oct 22, 2010

I have a directory of images consecutively numbered.

Is there a way to get the current higest filename - I had been thinking cfdirectory sorted by filename descending limited to 1 result but I don't think cfdirectory allows for that.

Mi-ul

772
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 22, 2010 Oct 22, 2010

CFDirectory returns a query.  Once you have that, you can use CF's Query-of-a-Query functionality to order and retrieve the data to your hearts content.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 22, 2010 Oct 22, 2010

I was hoping to do it in the original function as there are lots of files and it takes a while to run the original query

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 22, 2010 Oct 22, 2010
LATEST

The original function, as you describe it, is cfdirectory.  You only have to do it once.  A Q of Q on the resulting query should be pretty quick, unless you have millions of files to deal with.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources