Putting aside for the moment that such a program, can be written, because it can
, why do you want this? How are you going to use it?
I ask because it will fundamentally determine how such a program would work. I mean, what would you do with a listing of a thousand files that went ten sub directories deep? What purpose would it serve?
For example, do this. Open a command prompt and run this.
dir c:\windows /S /B > c:\filelist.txt
Wait about 15 seconds and then open up the 1+ MB file it produces (c:\filelist.txt). What good is it?