Determine media type

C

csjasnoch

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.
 
C

csjasnoch

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:(
 
C

csjasnoch

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

Guillaume Marcais

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.
 
C

csjasnoch

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:(
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top