Is there a way to show the file count without listing the files?
I have a Java program in which I want to list the total number of files on the hard drive of the Windows computer. The only ways that I know of list all the files before printing the total.
There’s no way to get the number of files without enumerating the whole folder tree. Note that you don’t have to visit each file, but should be able to get a file count in each folder which you then accumulate as you traverse the tree. I believe this is the fastest way to do what you want.