Skip to content

Instantly share code, notes, and snippets.

@mishrsud
Created March 4, 2018 23:46
Show Gist options
  • Select an option

  • Save mishrsud/eb58799e9a3fe5c35536ba46d73dc2d9 to your computer and use it in GitHub Desktop.

Select an option

Save mishrsud/eb58799e9a3fe5c35536ba46d73dc2d9 to your computer and use it in GitHub Desktop.
Converts a Windows path to Unix path that can be used from WSL (Windows Subsystem for Linux)
var path = @"C:\SourceCode\docker-test-framework\Core\app.config";
var cdriveRepl = string.Concat("/", "mnt", "/", "c", "/");
var unixPathSep = "/";
Console.WriteLine(path.Replace(@"C:\", cdriveRepl).Replace(@"\", unixPathSep));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment