3

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:

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.

Which .NET APIs should I use?

Heinrich Ulbricht
  • 10,064
  • 4
  • 54
  • 85
  • You should check if any discussion threads can be found on GitHub, https://github.com/dotnet/runtime/issues or start a new one if needed. – Lex Li Mar 13 '21 at 23:50
  • @LexLi There is indeed a discussion around this here: https://github.com/dotnet/runtime/issues/30321 - but this also ends with a direction I do *not* mean: *I guess meta is directly related to the file type such as an mp3, pdf, or epub.* And this comment about xattr is rather discouraging: *Windows has extended attribute capability but they're almost never used, they may be used more on other platforms but I think it's still quite rare. There would need to be a compelling use case for them to be included in the BCL.* :-/ – Heinrich Ulbricht Mar 14 '21 at 09:44

1 Answers1

2

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

Heinrich Ulbricht
  • 10,064
  • 4
  • 54
  • 85