Reading disk label?

B

Brian Pipa

Anyone know of a (JNI) library that will read the disk label off of a
disk? I know in Windows I can do it with the VOL command and I can
Runtime.exec() vol to get it, but I was wondering if anyone knew of a
class or soem JNI code that does this in a cross-platform way.

BTW - anyone know how to do the DOS equivalent of the VOL command on unix?

Brian
 
C

Chris Smith

Brian said:
Anyone know of a (JNI) library that will read the disk label off of a
disk? I know in Windows I can do it with the VOL command and I can
Runtime.exec() vol to get it, but I was wondering if anyone knew of a
class or soem JNI code that does this in a cross-platform way.

I'd bet that JConfig can do this, though I don't know off the top of my
head. As JNI libraries go, it's probably available for more platforms
than pretty much anythying else you'll run across.
BTW - anyone know how to do the DOS equivalent of the VOL command on unix?

Please explain your question. If it's a DOS equivalent, then it's not
UNIX, or... I'm really confused by the wording there.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
B

Brian Pipa

Chris said:
I'd bet that JConfig can do this, though I don't know off the top of my
head. As JNI libraries go, it's probably available for more platforms
than pretty much anythying else you'll run across.
I haven't poked into it deeply, but that looks like it might be exactly
what I was looking for. Thanks!
Please explain your question. If it's a DOS equivalent, then it's not
UNIX, or... I'm really confused by the wording there.
The UNIX equivalent of DIR is LS
I'm windering what the UNIX equivalent of VOL is.

VOL returns the volume name (among other things) of a disk. What Unix
commend does something similar? Hmmm. According to
http://shekel.jct.ac.il/cc-res/online-doc/unixdos.html
VOl has no unix equivalent.

So, is there ANY way to get the volume name of a CD on Unix? (I guess I
need to ask this in a Unix forum :)

Brian
 
M

Marco Schmidt

Brian Pipa:

[...]
The UNIX equivalent of DIR is LS
I'm windering what the UNIX equivalent of VOL is.

That was the misunderstanding, you asked for the DOS equivalent of
VOL.

By the way, I've written a Java program to retrieve the label under
Windows with Java 1.4+. At least I think that it will only run under
Windows. It uses FileSystemView. See
<http://groups.google.com/[email protected]>,
VOL returns the volume name (among other things) of a disk. What Unix
commend does something similar? Hmmm. According to
http://shekel.jct.ac.il/cc-res/online-doc/unixdos.html
VOl has no unix equivalent.

So, is there ANY way to get the volume name of a CD on Unix? (I guess I
need to ask this in a Unix forum :)

I found <http://www.introcomp.co.uk/solaris/rdlabel.html>. But you
have to be root to run it.

Regards,
Marco
 
B

Brian Pipa

Marco said:
Brian Pipa:


That was the misunderstanding, you asked for the DOS equivalent of
VOL.
Ah. Yep - now that I re-read it you're right - didn't make much sense.
By the way, I've written a Java program to retrieve the label under
Windows with Java 1.4+. At least I think that it will only run under
Windows. It uses FileSystemView. See
<http://groups.google.com/[email protected]>,
<
Nice! I tried it on a WinNT box and it worked great. I'm going to give
it a go under linux tonight to see what happens. Even if it doesn't
work on linux, I'll use it for my app when running on Windows. Oddly
enough, when I use it on a floppy drive, it always returns the label as
3" FLOPPY instead of the actual volume name. No biggie since I don't
need it for floppies.

I made a few changes to the class itself. If you don't mind, I'm going
ot put it up for download with a few of my other freeware Java classes here:
http://filenabber.com/free-java-classes
and I'll give you credit for the original code.

Brian
 

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
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top