.NET:如何以 cross-platform 的方式设置 "extended file attributes"?
.NET: How to set "extended file attributes" in a cross-platform way?
我需要在 .NET 5 控制台应用程序中读取和修改 extended file attributes,该应用程序必须在 Windows 和 Linux 上运行(假设文件系统支持这些属性)。
这个问题之前也被问过(?)特定的上下文:
- Custom File Properties(自 2013 年起,无 cross-platform)
- Getting ANY extended file attribute in C#(2015年起,关注特殊情况或platform-specific解决方案)
- Obtaining file extended properties in .Net Core(从2017年开始,cross-platform,但仅限于某些特殊属性)
所以几年后,我想以一种非常通用的方式再次询问这些扩展文件属性,以获得明确的、有效的 cross-platform 答案。关于维基百科文章“Extended file attributes”中的那些属性。我想添加任意的(不限于标题或作者或其他内容)。任意 key/value 对。
我应该使用哪些 .NET API?
没有 API(还)。这是我添加它的建议:https://github.com/dotnet/runtime/issues/49604
我需要在 .NET 5 控制台应用程序中读取和修改 extended file attributes,该应用程序必须在 Windows 和 Linux 上运行(假设文件系统支持这些属性)。
这个问题之前也被问过(?)特定的上下文:
- Custom File Properties(自 2013 年起,无 cross-platform)
- Getting ANY extended file attribute in C#(2015年起,关注特殊情况或platform-specific解决方案)
- Obtaining file extended properties in .Net Core(从2017年开始,cross-platform,但仅限于某些特殊属性)
所以几年后,我想以一种非常通用的方式再次询问这些扩展文件属性,以获得明确的、有效的 cross-platform 答案。关于维基百科文章“Extended file attributes”中的那些属性。我想添加任意的(不限于标题或作者或其他内容)。任意 key/value 对。
我应该使用哪些 .NET API?
没有 API(还)。这是我添加它的建议:https://github.com/dotnet/runtime/issues/49604