[Mono-list] mono bug?: VolumeSeparatorChar (System.IO.Path)
Martin Aliger
martin_aliger@email.cz
Sat, 5 Oct 2002 21:47:05 +0200 (CEST)
>> Real problem is, that I do not know what MS guys means by setting VolumeSep
>> to '/'on Unixes (as docs says). It makes no sense to me... What about relative
>> paths as "a/b/c/d.exe" ? Full path could be e.g. "/home/alik/mono/a/b/c/d.exe" and
>>everything is ok... I was about to report fix to this as change VolumeSepChar
>> to '\0' (in runtime) but than read MS docs...
>
>Mmm, may be if DirectorySeparatorChar and VolumeSeparator char are the
>same character we can avoid the last condition in the if. Any
>objections?
This could solve situation. At least for now. But moving IsPathRooted function into runtime is cleaner IMO. I think that Macs are using drives as well as windows but drive is not one letter (not sure about that!). So test for Mac PathRooted should be different (e.g. "cdrom:/backup/"). Or maybe another platform is using similar scheme... We could not say now (runtime could - it is platform dependant)
>> BTW2: in Path.Combine current implementation the condition "
>> bool b2 = path2 [0] == DirectorySeparatorChar ||
>> path2 [0] == AltDirectorySeparatorChar;
>> " is always true (checked before with IsPathRooted)
>
>You meant false, right? Because if IsPathRooted returns true, path2 is
>returned. I will remove that one.
Yeah - false, of course. Sorry about that :-)
Martin
______________________________________________________________________________
SB KOMPLET® Informační ekonomický systém http://www.sb-komplet.cz
…umíme svoji práci!