For *nix systems, see Mike Hall’s “filesystem” module
(http://www.enteract.com/~mghall/ruby/ruby.html). You’ll be able to
identify floppy/cdrom drives by name (e.g. /mnt/floppy).
Regards,
Dan
···
-----Original Message-----
From: mgushee@havenrock.com [mailto:mgushee@havenrock.com]
Sent: Wednesday, March 05, 2003 12:00 PM
To: ruby-talk@ruby-lang.org
Subject: Re: Newbie question regarding drivesOn 6 Mar 2003 at 3:29, Chris Morris wrote:
From: “Sperberg, Roger” roger.sperberg@aspenpublishers.com
Can someone advise me of how to find out within my Ruby
program what
drives
are on a system, and what type of drive (local hard
drive, floppy,
CD-ROM,
etc.) they are?I’m working with a Win2000 system, but it might also be used by
someone running Linux.IIRC, I don’t think there’s a handy cross-platform solution.
And I wouldn’t expect to find one, given that Windows and Unix-like
platforms treat drives very differently. Unix (including Linux)
doesn’t even have a notion of “drives” in the sense that you mean it:
it provides a unified view of all available storage, wherein various
storage devices can be attached to the (virtual) filesystem at
arbitrary points. IMHO, this is very user-friendly–after all, why
should the user have to worry about which hard drive to use?
Storage is storage is storage. However, a side-effect of this design
is that if you do need to identify the storage devices, it takes
significantly more work than it does for Windows.–
Matt Gushee
Englewood, CO USA