• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading index of CD/DVD-ROM  RSS feed

 
Bernd Linde
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heya all

I hope this is the correct forum for this.
I wanna know what method I can use to get the index of a cd/dvd-rom.
I wanna to get the following info of each file on the disc:
Name, path, size, date created
I wanna search every Folder so it'll have 2 b recursive.


I now have an idea of how to seperate the cd/dvd-rom's from the hard drives (after the last 2 hours or reading throught the forums) by using the File.canWrite(), but what about CD-RW or DVD-RW?

Thnx alot in advance
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
checking for readonly on a file or directory is at best unreliable to determine whether you have a CD or harddisk or something else.
For example, if it were a floppy set to write protected you also get readonly.
Directories and files on harddisks can be set to readonly as well.

Best and probably only way is to use JNI and write some C code that detemines the drive type at hardware level.

To get info on all files, File has several methods which return arrays of File object for a directory.
By using these dilligently you should be able to get a complete file system tree.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!