[Mono-dev] DriveInfo implementation

Miguel de Icaza miguel at novell.com
Tue Dec 4 06:51:28 EST 2007


> > For Linux, the current "trivial" implementation is enough, a more
> > complete implementation probably should talk with DBus to Hal, but am
> > unsure about that.
> 
> It's not enough for me, as I need to get the free space in the FS.
> That's how I found out that this class is incomplete, and, after
> seeing that it had been so for a long time, decided to volunteer on
> it.

Ah, I see.  

> Hmm... You should be right about most unices, but I don't see the
> reason info would be hard to obtain in Linux - AFAIK it supports the
> statvfs(2) POSIX syscall, which df uses to get the FS data. I think it
> should provide most, if not all of the info needed. Besides, it's
> already in Mono.Posix.Native, so the code changes would probably not
> be too invasive.

If Mono.Posix has it, that seems to be enough.

> There _could_ be problems with esoteric (and not so strange) unices,
> as the massive display of #ifdefs in the GNU coreutils fsusage.[hc]
> shows, but, most probably it shouldn't be so tough for just Linux and
> BSD.

Correct.   In my opinion, this needs some "glue" support in C, to have
the C compiler assist us when we port to an OS that has different fields
(as you noticed fsusage.[hc] has that).

I do not know if Mono.Posix today does it, if it already does, then we
are set to go

> I will look further into it, thanks for the $address. However, even
> when I can use P/Invoke, shouldn't it be separated from the
> platform-independent code by an interface?

Not needed, just use an if based on the platform.

Miguel



More information about the Mono-devel-list mailing list