[Mono-dev] [PATCH] DriveInfo implementation - volume space
Javier Martín
lordhabbit at gmail.com
Fri Dec 7 08:45:40 EST 2007
Hi again!
Robert Jordan wrote:
>In GetDiskFreeSpaceEx you must check whether HAVE_STATFVS
>is defined and SetLastError (ERROR_NOT_SUPPORTED) otherwise.
Will do. This will cause the internall call to raise an IOException,
by the way. Should I turn that into a NotSupportedException for this
concrete case or leave IOException, since it's the only one documented
by MS for the relevant methods?.
>Please don't introduce new files for only one function.
>Move it to io.c/io.h which already contains similar APIs.
io.[hc] contains mainly file-like IO routines (files, pipes, console,
etc.). This is about "volume/mounts" management. Besides, io.[hc] is
already very bloated (as is icall.c, but that's another story), making
maintenance a daunting task. In fact, of the ~5 hours i devoted to the
Linux port, about 2 were spent calming down the horrified NetBeans/C
IDE, which went crazy over the includes - it ended up not being able
to find stdio.h o_O.
Furthermore, and even more important, I was planning to add at least
two more functions in volumes.[hc] in other, unrelated patches to add
the "get/set volume label" functionality and correct the bug I
mentioned in the patch post (FS type not being detected in Windows).
Actually, that last functionality already exists in Linux, but it's
partially broken (i.e. ntfs-3g and other FUSE show up as fuseblk), so
I though a major rethinking and unification of the code would help.
>Please convert the standalone test case into a unit test:
>mcs/class/corlib/Test/System.IO/DriveInfo.cs
>Guard the whole file with #if NET_2_0.
>Don't forget to add the file to
>mcs/class/corlib/corlib_test.dll.sources
>Tests on the 2.0 profile are run with
> make PROFILE=net_2_0 run-test
Will do, but what I submitted was not exactly a "test case", it was
more a "showcase". A test case should check for things like exceptions
being thrown or not in border cases, etc, shouldn't it?
I'm going out tonight, but I will probably have the thing ready by tomorrow.
Habbit
More information about the Mono-devel-list
mailing list