Re: Recursive File List - Help me problem solve please
really thats interesting punnetkay i wonder why
but it needs to work for me!
post above: thanks for that, but I dont want to list the roots I want to list the files and files in directories that are in all directories on a computer.
I think Ive got some stable code now. But I still want to know how to recursive scan the whole computer and not just a drive. At the moment I'm able to scan "C:\\" or "D:\\" and not both, does any one know how I can make that work?
post above: thanks for that, but I dont want to list the roots I want to list the files and files in directories that are in all directories on a computer.
I want it to be able to go through all roots (drives)...
With no user intervention, so without including "C:\\" or "." as a string in the source, or without a TextIO.java class.
As that is the part I was responding to. You will need to use that.
Quote ...
I think Ive got some stable code now. But I still want to know how to recursive scan the whole computer and not just a drive. At the moment I'm able to scan "C:\\" or "D:\\" and not both, does any one know how I can make that work?
See above. You can only "recursively" scan each drive/root one at a time. But you can loop over what the above mentioned method returns.
Re: Recursive File List - Help me problem solve please
The NPE (as the OP already knows from his post on www.java-forums.com (or is it org?)) is because listFiles will return null on an empty directory so he needs to add an if statement to check for that.
Re: Recursive File List - Help me problem solve please
can I add a equals() statement in the code above and from that print to the terminal window files that occur on more than one instance on the recursive scan?
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.