System.IO.Path or equivelent use with Unix paths

Posted by pm_2 on Stack Overflow See other posts from Stack Overflow or by pm_2
Published on 2010-05-06T09:04:44Z Indexed on 2010/05/06 9:08 UTC
Read the original article Hit count: 165

Filed under:
|
|
|

Is it possible to either use the System.IO.Path class, or some similar object to format a unix style path, providing similar functionality to the PATH class? For example, I can do:

Console.WriteLine(Path.Combine("c:\\", "windows"));

Which shows:

"C:\\windows"

But is I try a similar thing with forward slashes (/) it just reverses them for me.

Console.WriteLine(Path.Combine("/server", "mydir"));

Which shows:

"/server\\mydir"

© Stack Overflow or respective owner

Related posts about c#

Related posts about path