Closed springy76 closed 6 years ago
Could you elaborate a bit more? Currently the AlphaFS unit test shows this:
Input File Path: [C:\Users\jjangli\AppData\Local\Temp\File-EnumerateAlternateDataStreams-vmuejdrm.gjs]
A file is created and 2 streams are added.
Current stream Count(): [3]
Instance: [Alphaleonis.Win32.Filesystem.AlternateDataStreamInfo]
#001 FullPath = [\\?\C:\Users\jjangli\AppData\Local\Temp\File-EnumerateAlternateDataStreams-vmuejdrm.gjs::$DATA]
#002 Size = [10]
#003 StreamName = []
Instance: [Alphaleonis.Win32.Filesystem.AlternateDataStreamInfo]
#001 FullPath = [\\?\C:\Users\jjangli\AppData\Local\Temp\File-EnumerateAlternateDataStreams-vmuejdrm.gjs:myStreamTWO-ïtïrücrd.büf:$DATA]
#002 Size = [52]
#003 StreamName = [myStreamTWO-ïtïrücrd.büf]
Instance: [Alphaleonis.Win32.Filesystem.AlternateDataStreamInfo]
#001 FullPath = [\\?\C:\Users\jjangli\AppData\Local\Temp\File-EnumerateAlternateDataStreams-vmuejdrm.gjs:ӍƔŞtrëƛɱ-ysärzkfr.ëyg:$DATA]
#002 Size = [300]
#003 StreamName = [ӍƔŞtrëƛɱ-ysärzkfr.ëyg]
new Alphaleonis.Win32.Filesystem.FileInfo(@"\\?\C:\Users\jjangli\AppData\Local\Temp\File-EnumerateAlternateDataStreams-vmuejdrm.gjs:myStreamTWO-ïtïrücrd.büf:$DATA", Alphaleonis.Win32.Filesystem.PathFormat.LongFullPath)
-> Name property is "$DATA"
Omit the :$DATA
and the Name property is ok.
No it's not if it is an ADS of a directory -- then an additional backslash is needed before the ADS colon:
Works: more < \\server\share:AFP_AfpInfo:$DATA
Works NOT: more < \\server\share:AFP_AfpInfo
Works: more < \\server\share\:AFP_AfpInfo
.... oh damn, that even is OS specific. The above is true for Windows 10 (Pro), on Windows 2016 (Server) the backlash is needed always:
Works NOT: more < \\server\share:AFP_AfpInfo:$DATA
Works: more < \\server\share\:AFP_AfpInfo:$DATA
Works NOT: more < \\server\share:AFP_AfpInfo
Works: more < \\server\share\:AFP_AfpInfo
(Don't know what the official specs say, just what I discovered by now)
I think it's safe to say that :$DATA
can be omitted, given the many ADS examples on the net.
It is an attribute, you access the stream by name, the backslash thingy is new to me.
Is that more.com
or an executable using AlphaFS?
:$DATA should be the default if omitted. "more.com" exists since DOS times and is nearly the only way to test ADS directly on the OS. Code using AlphaFS behaves the same (throws errors when more
does not work and vice versa).
SysInternals Streams v1.6 is a good one.
Is the issue, regarding FileInfo.Name solved now by omitting :$DATA
?
"omitting"? I never introduced it. If I modify AlternateDataStreamInfo.FullPath by stripping away :$DATA and inserting the missing "\" before the rightmost ":", then it works.
I wonder if both of your classes could interact more smoothly.
Regarding "SysInternals Streams": dir /r
works too. But for testing the access (or viewing the contents) you cannot just use type file:ads
.
It BTW is not "more.com" which supports ADS but only "piping" using " | ", " > " or " < ".
I'm sorry, I'm trying to understand what the issue, regarding AlphaFS and ADS, is.
If it's about using ADS from AlphaFS, then take a peek at the unit tests. Basically it just boils down to using methods such as File.WriteAllLines and File.ReadAllLines so that's why there aren't any conveniece methods.
Perhaps a good idea to let AlphaFS strip away :$DATA
from the FullPath
property.
I think this needs some kind of special handling.