[Mono-dev] DriveInfo implementation
Miguel de Icaza
miguel at novell.com
Mon Dec 3 20:04:04 EST 2007
> I would like to help in the implementation of the System.IO.DriveInfo
> class, which as of now is semi-functional in Linux and little more
> than a stub in Windows. However, after thinking a bit about it, I've
> come to the conclusion that the methods that discover the volumes in
> the system (*GetDrives) require P/Invoke at the very least (windows),
> and possibly even unmanaged code (linux).
Correct, for Windows we should use P/Invokes.
For Linux, the current "trivial" implementation is enough, a more
complete implementation probably should talk with DBus to Hal, but am
unsure about that.
For Unix, a full solution probably needs to use Mono.Posix to get the
file system information (notice that information about actual devices is
hard to obtain in Linux, unless we use something like Hal).
> The point of this message is asking for directions and rules on this
> matter. Is unmanaged code (at all) allowed? Can I create a portable
> "interface" (not necessarily a .NET interface) and then a separated,
> system-dependant implementation? How are those platform-dependant
> switches managed in the Mono autoconf files? Etcetera.
I believe that for the Windows case, you could get away with P/Invoke,
we have used glue in the past, see the mono/support directory, it
contains plenty of portability glue.
> I would appreciate any pointers on the matter.
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
More information about the Mono-devel-list