• Post Reply Bookmark Topic Watch Topic
  • New Topic

scanning through file systems  RSS feed

 
Ajay Divakaran
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I browse through all the file systems such as C,D,E and so on..
How do I know what drives are present on the computer??
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The File class contains all the methods you need. Use listRoots() to find the root drives available, and for each one, use listFiles() to find the files in a given directory. You will probably want to write a recursive method to list the files in each subdirectory. You may also want to use other File methods like isDirectory() and getName(). Hope that helps...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!