c# - Cross-platform filepaths comparison -
I'm trying to check whether two file path strings specify the same path.
We know the path that Windows is not case-sensitive.
Path. Gatefulpath (path 1). Aqualus (path. Gatefulpath (Path 2), String Comparison. Current Culture Igor Cass) I know that this will not work properly on Linux, because the path is there Case-sensitive. That's why I am searching for some point-of-the-road signs for sensitivity. Or for some functions like path.Equals . In your case, this is probably the easiest (and most reliable) to check if the
is equal to '/' or '\' and if it is pre-call the same method without the "undiscovered case" section. In full:
if (path. Directory seirter room == '/') {path. Gatefulpath (path 1). Ecloss (path. Gatefulpath (Path 2), String Companion.Currentculture); } And Path (Gatefulpath (path 1) .Equals (PathGetfulpath (Path 2), String Comperson. Current Culture Ignore Seas);}
Comments
Post a Comment