-
I am trying to get the ADS (Alternate Data Streams) working with the Mirror sample in c#. In the FindStreams I am iterating over the Streams for the file and adding the appropriate values to the out streams variable, but it's only seeing the first one when I use powershell to show the streams. Also the paths are messed up for the values. I used the default mirror and it works correctly. ANy ideas where I need to look next? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Could you share some code, particularly your |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
It's writing the stream, but if I just query for the Stream in powershell it's missing the MyXML stream |
Beta Was this translation helpful? Give feedback.
-
Are you really sure about what format this |
Beta Was this translation helpful? Give feedback.
-
When using powershell -Stream, it returns 2 streams. A $DATA and $MyXML. That is also what is returned when I use the FindFirstStream and FindNextStream API calls ( which is what I use in FileStreamSearcher.GetStreams). I worked around the issue by only including MyXML instead of trying to write both streams. |
Beta Was this translation helpful? Give feedback.
-
Okay, this is a bit complicated but in short, |
Beta Was this translation helpful? Give feedback.
Okay, this is a bit complicated but in short,
$DATA
is not a stream name, it is a stream type. In this case for the main unnamed data stream of the file, the stream that you get if you just open the file without specifying a stream name. If you usedir /r
at command prompt, you will not see:$DATA
suffixed to the default streams even though it is technically there.$DATA
is however suffixed to all other data stream names. In PowerShell it is kind of the other way around, when usingGet-Content -Stream
the output is suffixed with$DATA
for the main unnamed stream only and not for any other named data stream. I understand that this could be confusing but it is the way it works. So if you us…