|
|
@ -58,6 +58,8 @@ namespace ZeroLevel.Services.FileSystem
|
|
|
|
private static string _invalid_filename_characters = new string(Path.GetInvalidFileNameChars());
|
|
|
|
private static string _invalid_filename_characters = new string(Path.GetInvalidFileNameChars());
|
|
|
|
private static HashSet<string> _invalidRootFileNames = new HashSet<string> { "$mft", "$mftmirr", "$logfile", "$volume", "$attrdef", "$bitmap", "$boot", "$badclus", "$secure", "$upcase", "$extend", "$quota", "$objid", "$reparse" };
|
|
|
|
private static HashSet<string> _invalidRootFileNames = new HashSet<string> { "$mft", "$mftmirr", "$logfile", "$volume", "$attrdef", "$bitmap", "$boot", "$badclus", "$secure", "$upcase", "$extend", "$quota", "$objid", "$reparse" };
|
|
|
|
private static bool StartWithInvalidWindowsPrefix(string name)
|
|
|
|
private static bool StartWithInvalidWindowsPrefix(string name)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (name.Length >= 3)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (name[0])
|
|
|
|
switch (name[0])
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -71,7 +73,7 @@ namespace ZeroLevel.Services.FileSystem
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 'x':
|
|
|
|
case 'x':
|
|
|
|
case 'X':
|
|
|
|
case 'X':
|
|
|
|
return name[3] == '.'; // AUX.
|
|
|
|
return name.Length == 3 || name[3] == '.'; // AUX.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -86,10 +88,10 @@ namespace ZeroLevel.Services.FileSystem
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 'n':
|
|
|
|
case 'n':
|
|
|
|
case 'N':
|
|
|
|
case 'N':
|
|
|
|
return name[3] == '.'; // CON.
|
|
|
|
return name.Length == 3 || name[3] == '.'; // CON.
|
|
|
|
case 'm':
|
|
|
|
case 'm':
|
|
|
|
case 'M':
|
|
|
|
case 'M':
|
|
|
|
return char.IsDigit(name[3]) && name[4] == '.'; // COM0 - COM9
|
|
|
|
return name.Length >= 4 && char.IsDigit(name[3]) && (name.Length == 4 || name[4] == '.'); // COM0 - COM9
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -104,7 +106,7 @@ namespace ZeroLevel.Services.FileSystem
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 't':
|
|
|
|
case 't':
|
|
|
|
case 'T':
|
|
|
|
case 'T':
|
|
|
|
return char.IsDigit(name[3]) && name[4] == '.'; // LPT0 - LPT9
|
|
|
|
return name.Length >= 4 && char.IsDigit(name[3]) && (name.Length == 4 || name[4] == '.'); // LPT0 - LPT9
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -119,7 +121,7 @@ namespace ZeroLevel.Services.FileSystem
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 'n':
|
|
|
|
case 'n':
|
|
|
|
case 'N':
|
|
|
|
case 'N':
|
|
|
|
return name[3] == '.'; // PRN.
|
|
|
|
return name.Length == 3 || name[3] == '.'; // PRN.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -134,12 +136,13 @@ namespace ZeroLevel.Services.FileSystem
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 'l':
|
|
|
|
case 'l':
|
|
|
|
case 'L':
|
|
|
|
case 'L':
|
|
|
|
return name[3] == '.'; // NUL.
|
|
|
|
return name.Length == 3 || name[3] == '.'; // NUL.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|