[Mono-dev] [PATCH] Support for AvailableFreeSpace, TotalFreeSpace, TotalSize in System.IO.DriveInfo

Christian Prochnow cproch at seculogix.de
Thu Jan 8 08:35:49 EST 2009


Hi,

Raja R Harinath schrieb:
> According to gnulib
> 
>   This function is missing on some platforms:
>   MacOS X 10.3, OpenBSD 3.8, mingw.

I've changed the implementation of GetDiskFreeSpaceEx() to use statvfs()
or statfs(). It falls back to guint64 MaxValue if none of these
functions are available.

I've also added the GetDriveType() wrapper to query a drive's type.
GetDriveType() currently uses /etc/[mtab|mnttab] to query the
filesystem, but it can be improved to use statfs.f_typename or
statvfs.f_type on systems which support it (cause /etc/mtab doesnt exist
on darwin).


Best regards,

Christian Prochnow


-- 
Christian Prochnow
Geschäftsführer

SecuLogiX Systems GmbH
Mohriner Allee 28
12347 Berlin

http://www.seculogix.de

mobile:  +49 (0)177 313 02 57
   fon:  +49 (0)700 SECULOGIX

Geschäftsführer: Christian Prochnow
Handelsregister: B 96491, Amtsgericht Charlottenburg
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mono-122751-driveinfo.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090108/8793d51c/attachment-0002.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mono-122751-io-layer.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090108/8793d51c/attachment-0003.pl 


More information about the Mono-devel-list mailing list