Support for ADS (Alternate Data Streams)

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jan 10 09:27:30 GMT 2022


On Jan  8 04:14, NightStrike wrote:
> On Wed, Jan 5, 2022, 05:08 Corinna Vinschen <corinna-cygwin@cygwin.com>
> wrote:
> 
> > On Jan  3 22:40, NightStrike wrote:
> > > On Sun, Jan 2, 2022, 15:51 <cygwin@kosowsky.org> wrote:
> > >
> > > > While I recognize that ADS is not supported by POSIX, I was wondering
> > > > what if any support for ADS might exist within Cygwin.
> > > >
> > > > The last time I looked into this was probably more than a decade ago
> > > > but I am seeing (unfortunately) more usage of ADS in the Windows
> > > > world, so I was wondering if there has been any effort to support in
> > > > Cygwin?
> > > >
> > > > --
> > > > Problem reports:      https://cygwin.com/problems.html
> > > > FAQ:                  https://cygwin.com/faq/
> > > > Documentation:        https://cygwin.com/docs.html
> > > > Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
> > >
> > >
> > > FWIW, ntfs-3g under Linux maps these to extended attributes
> >
> > Using the EA API as ntfs-3g with the streams_interface=xattr option
> > seems like a nice way to allow reading and writing ADS on Cygwin as
> > well.
> >
> > Do you know how ntfs-3g performs the mapping?  For instance, I guess
> > that ADS are stored in the user.* namespace?  Does listxattr list ADS or
> > does it skip them?  Stuff like that.
> >
> 
> The ntfs.streams.list attribute contains the stream names, and there's a
> shortcut to access them by name with a colon. So if you have a stream named
> str and a file named f.txt, you could do 'cat f.txt:str'.

Hmm, that's not quite what I expected.  We could support an EA like
ntfs.streams.list, but we can't use the colon syntax.

We could map streams to EAs so they are read with getxattr and written
with setxattr.  Or we would have to invent a different way.


Corinna


More information about the Cygwin mailing list