Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CD-ROM drive letter  RSS feed

 
Raed Qudaisat
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
is there a way in java to know the cd-rom drive letter ( D, E, ... ) and check if there is a cd in the drive?

Thank you.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. The File class has a listRoots() method which will give you the roots of the various file systems. On Windows, this would correspond to the different drives. I am not aware of any way to differentiate a CD/DVD drive from a hard disc, flash drive, card reader and so on.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!