Determine media type

I am trying to write a catalogging program for a bunch of data we
compile at my work.

I was wondering if there is a way to determine some of the following

CD or DVD?

So do something like
Dir.chdir("D:/")

and then know if I am reading from a CD or DVD. Is this possible?

I would also like to find times and days the files were last altered,
if the media is re-writtable, and how much space is open if it is.

Thank you for any help.

It seems like I should be able to do this for determining write
capabilities

FileTest.writable?("F:/")

but I have placed a blank DVD in the drive (drive F a DVD
burner/reader) and it returns false:(

Also via most OS's you can give a disk a name. How would I access this
name from ruby?

I am afraid all the question you have asked are very OS specific and
Ruby has no built-ins to do these things directly. Your best bet is to
find a library on RAA or rubyforge.org that do what you ask. Or to find
the appropriate system calls and call them from within ruby with OLE or
rubydl.

It is all very vague, but I have to admit I don't really know on top of
my head how to solve your problem.

Hope this help,
Guillaume.

ยทยทยท

On Tue, 2005-10-04 at 06:36 +0900, csjasnoch@wisc.edu wrote:

Also via most OS's you can give a disk a name. How would I access this
name from ruby?

I was hoping that was not the case (OS specific), but I could make
multiple versions.

I cant find anything on how I would grab the disc name though for any
OS:(