[Mono-dev] [PATCH] DriveInfo implementation - volume space

Robert Jordan robertj at gmx.net
Fri Dec 7 08:08:04 EST 2007


Javier Martín wrote:
> Well, everything with a start has its end, and it's time for this
> particular one. This patch implements the volume space properties in
> [corlib]System.IO.DriveInfo, both in Windows and Linux. Incidentally,
> it also implements the helper WindowsGetDrives method, which was
> previously a stub, but only to the point that's useful to this patch:
> it still lacks the functionality to detect the volume filesystem type.
> This functionality has been implemented through a new internal call in
> icall.c & icall-def.h (DRVINF_1) that relies on a Win32 API not
> previously replicated in io-layer (GetDiskFreeSpaceEx). Thus, some
> files in io-layer have been modified:
>     * volumes.[hc] (NEW) : volume & fs management. Contains the new
> win32 call POSIX replacement, based on statvfs.

In GetDiskFreeSpaceEx you must check whether HAVE_STATFVS
is defined and SetLastError (ERROR_NOT_SUPPORTED) otherwise.

Please don't introduce new files for only one function.
Move it to io.c/io.h which already contains similar APIs.

> I also include a test case (Program.cs) for the new functionality.
> When compiled and run with the drive/mount to get info about (i.e.
> Program.exe C:), it should output something like:

Please convert the standalone test case into a unit test:


Guard the whole file with #if NET_2_0.

Don't forget to add the file to


Tests on the 2.0 profile are run with

	make PROFILE=net_2_0 run-test

> OT2: why does it take waaaaay longer to compile mono in cygwin than in
> Linux? Is it bash, cygwin.dll or both?

Both, coupled with Windows' inability to start processes efficiently.


More information about the Mono-devel-list mailing list