• Post Reply Bookmark Topic Watch Topic
  • New Topic

auto detect CDRom  RSS feed

 
ajay tiwari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
all i want to auto detect cdrom using java plz some one help me.
means when my program is started it directaly readfrom a cdrom
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"auto detect" a CD means something a little different. When you insert a disk and a program on it starts up, that's "auto detect". You just want to find a disk and read it. Java doesn't have a way to distinguish the CD from any of the other drives on a system (which can be had through the java.io.File listRoots() method). Are you creating the CD yourself? Perhaps you could seed it with some data to distinguish it from the other drives in a system.
 
ajay tiwari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanku for your help
actually i devlope a software for reading a cd and i want when i insert a our program automatically detect this drive and start processing if possible then plz help me
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Other than getting the list of roots and watching for a change and hoping the new disk is the one you want, I don't think you can do that from an application. CD's have a file on them, autorun.inf, which tells the OS what to do when they are inserted (example). You could start some app to send a message to your app that a disk is available. . .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!