Accessing alternate data streams in files

人盡茶涼 提交于 2019-12-11 05:44:41

问题


On an NTFS file system, it is possible to have alternate data streams within a single file. Is it possible to access this information in a fully managed way?

EDIT: additionally, I want to read from the alternate stream in an existing file. How is this achieved (using PInvoke if not possible using managed code only)?

This question is similar, but is from early 2009 and the .Net answer uses PInvoke to write to a file, not read from it. Has support for this been added since then (to .Net 4.0?) that can do it without using PInvoke?


回答1:


Unfortunately no, there is still no access via a managed .Net Framework API.

Update

Here's a library\source for an ADS access wrapper:

http://www.codeproject.com/KB/cs/ntfsstreams.aspx



来源:https://stackoverflow.com/questions/4387877/accessing-alternate-data-streams-in-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!