[Mono-devel-list] [PATCH] GetFolderPath improvements
Todd Berman
tberman at sevenl.net
Tue Jun 15 20:57:40 EDT 2004
Ben Maurer wrote:
> On Tue, 2004-06-15 at 20:14, Todd Berman wrote:
>
>>So we are moving a chunk of code from corlib to the runtime to prevent a
>> switch in a method that is not used more than once or twice if even at
>>all in an average program's lifecycle?
>
>
> Removing the switch was not the point of this patch.
>
> My point was that there is alot of data about the system that we gain
> from autoconf, and from the ability to call system apis (such as
> g_get_home_dir)
> A. must pass to corlib via some internal api (requires adding an
> icall or
> B. deal with in unmanaged code
>
> Both methods require an icall. But method B keeps all the code in one
> place whereas method A requires syncing between corlib and the runtime.
>
> Doing this in unmanaged code leaves a nice clean interface.
>
> Also, note that there are very few places in which we test for Unix
> right now. The only places where I can see this sort of test are in
> Console and System.Security.Principal. OTOH, there are tons of tests
> like this in metadata.
>
> -- Ben
>
>
I don't quite understand why, I don't see any code you are doing now
that can't be accomplished via Path.Combine
(Environment.GetEnvironmentVariable ("HOME"), something);
in fact, I know inside MD, we perform at least 2 or 3 of those string
manipulations outselves (to follow the fd.o standard).
So again, I ask why moving this into unmanaged code is needed.
--Todd
More information about the Mono-devel-list
mailing list