Scan all files in a directory and return counts by file type

后端 未结 1 1673
生来不讨喜
生来不讨喜 2021-01-26 11:29

I have just joined an IT company & started working with ColdFusion. My Manager wants me to write code in ColdFusion which:

  1. Will scan any directory (say c
1条回答
  •  独厮守ぢ
    2021-01-26 11:57

    For the first question, there's two approaches. Either loop over each of the different file types you're interested in, doing a cfdirectory for each.

    
    
    
    
    
    
                 
        No of #filetypes[i]# files: #files.recordCount#

    Or you can do multiple file types in one CFDirectory, see http://www.bennadel.com/blog/1221-CFDirectory-Filtering-Uses-Pipe-Character-For-Multiple-Filters-Thanks-Steve-Withington-.htm

             
    No of JS/CFM/PDF files: #files.recordCount#
    

    0 讨论(0)
提交回复
热议问题