You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var path = "zj\\qj\\zjqjyed9vclmuljlky2nxv-6v-Thumbs\\zjqjyed9vclmuljlky2nxv-6v01.jpg";
var directory = Path.GetDirectoryName(path);
Console.WriteLine(directory);
On Windows Path.GetDirectoryName(path) returns:
zj\qj\zjqjyed9vclmuljlky2nxv-6v-Thumbs
Which is expected while on Linux returns empty.
dotnet --version:
.Net core 2.2.104
Windows environment:
Win10
Linux:
Ubuntu 18.04 LTS
The text was updated successfully, but these errors were encountered:
On windows \ is the standard and / is the alt directory separator char. On linux / is the only separator char and \ is a valid filename character. So linux interprets the path you give it according to the local rules and finds no directory separator char to split on, this is behaving as expected.
Consider this code snippet:
On Windows
Path.GetDirectoryName(path)
returns:Which is expected while on Linux returns empty.
dotnet --version:
.Net core 2.2.104
Windows environment:
Win10
Linux:
Ubuntu 18.04 LTS
The text was updated successfully, but these errors were encountered: