• Post Reply Bookmark Topic Watch Topic
  • New Topic

any function in java which will return the local drives and its contents  RSS feed

 
Srinath R
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
is their any function in any of the package which will help in finding out the drives present on the local disk. and subsequently find its contents( i mean the contents of the drives and folders and.. etc.)
srinath
 
Srinath R
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its realy surprising to c that their is no reply to this question, is it to say that their are no methods or it is because no body knows if their is any function which does this job.
kindly respond plz
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well there's lots of things which will help. The best place to look may be to check out the source for a file chooser (such as JFileChooser). If it can show all the disks to the user, presumably it can find them.
 
Chandar Vel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Srinath
There is also a static method in File called listRoots(). I think it gives the drive. You can try that. I'm not sure how it works in unix though.
Hope this helps
Chandar
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!