cdrom access though java

A

Adam Gordon

Hello,

I'm trying to write a java program that will access a cd-rom drive. I just
want to treat the drive as one big file where I can grab bytes off of.
Right now I can use java.io.RandomAccessFile to do that.

One that that I can't figure out is how to have my program detect if there
is actaully a cd in the drive instead of just throwing an I/O exception. My
reason for wanting to make this distinction is that if the CD is scratched
there will also be an I/O Exeption, and I want to handle those dirrerently.

Thanks,
 
T

Thomas Weidenfeller

Adam said:
One that that I can't figure out is how to have my program detect if there
is actaully a cd in the drive instead of just throwing an I/O exception.

You have no such interface in Java. Unfortunately the interfaces to the
file system in Java leave some things to be desired.

Consider using JNI.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top