[Mono-dev] DriveInfo

Jonathan Pryor jonpryor at vt.edu
Thu Feb 9 06:48:43 EST 2006


On Thu, 2006-02-09 at 14:40 +1300, Thong Nguyen wrote:
> I notice that there is already a UnixDriveInfo.  I'm implementing a
> System.IO.DriveInfo that currently just reflects on UnixDriveInfo.

As a sanity check, you should make sure your DriveInfo members reflect
the final .NET 2.0 DriveInfo members.  I wrote UnixDriveInfo during one
of the .NET 2.0 betas, so it's entirely possible that they added/changed
the members.

> UnixDriveInfo currently doesn't do any "DriveType" detection -- is there a
> reliable POSIX way of detecting the "type" of a disk (cdrom, ram, etc).

If I knew of one, I'd have used it. :-)

I'd love to know an answer to this one.  This information might be
available via some ioctl(2) call, and if that's true you'll have more
trouble than me, since you'll need to add the appropriate Win32 calls to
I/O layer and use an internal call, since mscorlib.dll can't depend on
Mono.Posix.dll...

> UnixDriveInfo.GetDrives reads fstab which doesn't work with disks mounted
> but not listed in fstab (disks mounted manually or by automount).  Anyone
> got any good proposals on the best way to handle this?

HAL?  Alas, that isn't POSIX; it's only used by Gnome afaik.

This is another area that doesn't seem to be well supported by POSIX.

 - Jon





More information about the Mono-devel-list mailing list