处理linux文件命名长度问题,统一调整为60

This commit is contained in:
jianzhichu
2025-12-01 01:20:05 +08:00
parent 77628c9833
commit 8744d280c7
6 changed files with 14 additions and 16 deletions
+3 -4
View File
@@ -12,9 +12,8 @@ namespace dy.net.utils
{
#region
/// <summary>
/// 建议120字节(约60个汉字),适配所有系统
/// </summary>
private const int MaxFileNameBytes = 120;
private const int MaxFileNameBytes = 60;
@@ -147,9 +146,9 @@ namespace dy.net.utils
{
path = path.Replace(c, '_');
}
if (path.Length > 100)
if (path.Length > 60)
{
path = path.Substring(0, 100);
path = path.Substring(0, 60);
}
return path.Trim().Replace(" ", "");
}