Merge branch 'rmcrackan:master' into master
This commit is contained in:
commit
ef973ac56a
@ -15,7 +15,7 @@ namespace FileManager
|
||||
public const int MaxFilenameLength = 255;
|
||||
|
||||
private const int MAX_PATH = 260;
|
||||
private const string LONG_PATH_PREFIX = "\\\\?\\";
|
||||
private const string LONG_PATH_PREFIX = @"\\?\";
|
||||
|
||||
public string Path { get; init; }
|
||||
public override string ToString() => Path;
|
||||
@ -35,13 +35,13 @@ namespace FileManager
|
||||
|
||||
if (path.StartsWith(LONG_PATH_PREFIX))
|
||||
return new LongPath { Path = path };
|
||||
else if ((path.Length > 2 && path[1] == ':') || path.StartsWith("UNC\\"))
|
||||
else if ((path.Length > 2 && path[1] == ':') || path.StartsWith(@"UNC\"))
|
||||
return new LongPath { Path = LONG_PATH_PREFIX + path };
|
||||
else if (path.StartsWith("\\\\"))
|
||||
else if (path.StartsWith(@"\\"))
|
||||
//The "\\?\" prefix can also be used with paths constructed according to the
|
||||
//universal naming convention (UNC). To specify such a path using UNC, use
|
||||
//the "\\?\UNC\" prefix.
|
||||
return new LongPath { Path = LONG_PATH_PREFIX + "UNC\\" + path.Substring(2) };
|
||||
return new LongPath { Path = LONG_PATH_PREFIX + @"UNC\" + path.Substring(2) };
|
||||
else
|
||||
{
|
||||
//These prefixes are not used as part of the path itself. They indicate that
|
||||
|
||||
@ -179,6 +179,7 @@ namespace FileManager
|
||||
}
|
||||
catch (Exception exDebug)
|
||||
{
|
||||
Serilog.Log.Logger.Debug(exDebug, "Silent failure");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ namespace AccountsTests
|
||||
{
|
||||
public class AccountsTestBase
|
||||
{
|
||||
protected const string EMPTY_FILE = "{\r\n \"Accounts\": []\r\n}";
|
||||
protected string EMPTY_FILE { get; } = "{\r\n \"Accounts\": []\r\n}".Replace("\r\n", Environment.NewLine);
|
||||
|
||||
protected string TestFile;
|
||||
protected Locale usLocale => Localization.Get("us");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user