Using constants rather than copied hardcoded strings

This commit is contained in:
Carl Johnsen
2026-03-05 16:08:32 +01:00
parent ca1fb3ac9b
commit 222ec0433a
5 changed files with 39 additions and 18 deletions
+1 -8
View File
@@ -58,14 +58,7 @@ public class WebModule : IWebModule
return res;
}
string prefix = "";
if (OperatingSystem.IsWindows())
prefix = "\\\\.\\";
else if (OperatingSystem.IsMacOS())
prefix = "/dev/";
else
throw new PlatformNotSupportedException(Strings.PlatformNotSupported);
var prefix = SourceProvider.GetDevicePrefix();
List<string> parts = [.. path[prefix.Length..].Split(Path.DirectorySeparatorChar, 2)];
var physicalDrivePath = prefix + parts.First();
var subpath = parts.Last();