.NET:如何设置“扩展文件属性"以跨平台的方式? [英] .NET: How to set "extended file attributes" in a cross-platform way?

查看:28
本文介绍了.NET:如何设置“扩展文件属性"以跨平台的方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 .NET 5 控制台应用程序中阅读和修改扩展文件属性必须适用于 Windows 和 Linux(假设文件系统支持这些属性).

I need to read and modify extended file attributes in a .NET 5 console application that must work on Windows and Linux (assuming that the files system supports those attributes).

这个问题之前也被问过(?)特定的上下文:

This question has been asked with too(?) specific contexts before:

  • Custom File Properties (from 2013, no cross-platform)
  • Getting ANY extended file attribute in C# (from 2015, focusing on special cases or platform-specific solutions)
  • Obtaining file extended properties in .Net Core (from 2017, cross-platform, but restricted to some special attributes)

所以几年后,我想以非常通用的方式再次询问那些扩展文件属性,以获得明确的、有效的、跨平台的答案.关于维基百科文章扩展文件属性"中的这些属性.我想添加任意的(不限于标题或作者之类的).任何键/值对.

So some years later I want to ask again in a very generic way about those extended file attributes to get a definitive, working, cross-platform answer. About those attributes from the Wikipedia article "Extended file attributes". I want to add arbitrary ones (not restricted to Title or Author or something). Any key/value pair.

我应该使用哪些 .NET API?

Which .NET APIs should I use?

推荐答案

目前还没有 API.这是我添加它的建议:https://github.com/dotnet/runtime/issues/49604

There is no API (yet). Here's my proposal to add it: https://github.com/dotnet/runtime/issues/49604

这篇关于.NET:如何设置“扩展文件属性"以跨平台的方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆