[Mono-list] Path.AltDirectorySeparatorChar - why is this a forward slash?

Joshua Gage jgage at kyocera-wireless.com
Thu Nov 3 21:02:01 EST 2005


Hi all,

I'm porting an app from Windows .NET to Linux/Mono and I've just run 
across some curious behavior.

We make heavy use of the Path class, DirectorySeparatorChar and 
AltDirectorySeparatorChar fields.

On Windows/.Net:
SepChar: '\'        -- as expected
AltSepChar: '/'   -- as expected

On Linux/Mono:
SepChar: '/'     -- as expected
AltSepChar: '/'    -- not expected

In the MSDN doc it says for AltDirectorySeparatorChar the value is a 
backslash '\' on Unix systems
In the Mono doc is says for AltDirectorySeparatorChar the value is a 
forward slash '/' on Unix Systems

I'm curious why the Mono project choose to make both fields the same 
value. To me this is unexpected; it seems the whole point of having a 
alternate character is to handle converting between the two types of 
slashes when going from one system to another.

Can anyone enlighten me on why it is this way?

Thanks,
- Josh



More information about the Mono-list mailing list