I have a directory on my portable hard drive, with around 350000 files under it (there is no subdirectory, only files). I want to get all the file dirs so use
filedirs=FileNames["*",mydir]
However, the code above run for more than 1 hour and still not return a result. Why is FileNames
so slow? What should I do?
I'm using Mathematica 12.0 on my Win10.
The problem is bypassed by running tree dir /f /a >outputtxt
on win10's cmd window, as suggested by @mikado. The size of outputtxt is only ~20M and it takes only several minites to get result. I still don't understand why FileNames
will take astonishing time to run.
tree dir /f /a >outputtxt
I get the filename list. @mikado $\endgroup$