X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 	tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4B01462A.3080400@towo.net>
References: <26363833.post@talk.nabble.com> 	 <416096c60911151427g12cc5582t6d9bbdc063c5b14a@mail.gmail.com> 	 <4B013E09.1010209@towo.net> 	 <20091116120650.GH29173@calimero.vinschen.de> 	 <4B01462A.3080400@towo.net>
Date: Mon, 16 Nov 2009 13:32:57 +0000
Message-ID: <416096c60911160532j2c49cd7ftb79fcc7295f9be21@mail.gmail.com>
Subject: Re: Seems like treatment of NTFS ADS (foo:bar) changed between 1.5  	and 1.7 but not mentioned in What's Changed
From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

2009/11/16 Thomas Wolff:
>>>> I'd suspect the support for ADSs in 1.5 was rather accidental anyway.
>>>> POSIX programs certainly don't know about them, and you get the rather
>>>> weird situation that "files" like foo:bar can be accessed but don't
>>>> show up in the directory they're in. Hence I think the right way to
>>>> access ADSs is via Windows tools. Unless there is a POSIXy way to
>>>> represent them?
>>>>
>>>
>>> I've only learned about this ADS stuff recently but yes, I think,
>>> simply using the "a:b" syntax (which is also used by Windows tools)
>>> and handling them as a virtual file is a quite obvious POSIX way to
>>> do it.
>>> So if it worked in 1.5, whether accidental or not, I think it should
>>> continue to work in 1.7.
>>>
>>
>> It's a deliberate change. =C2=A0It's more important to support as much P=
OSIXy
>> filenames as possible than to access streams. =C2=A0I agree with Andy. =
=C2=A0Use
>> Windows tools to use them.
>>
>
> But with it being supported, "foo:bar" *is* a POSIX filename and can quite
> transparently be handled like a file

If you create a file called "foo:bar" in Cygwin 1.5, a directory
listing will actually show a file called "foo" of size 0. You have to
already know that "foo:bar" exists to access it, and there's no way in
Cygwin to find those files.

Furthermore, if you delete the file "foo", you'll also delete
"foo:bar" and any other ADSs of "foo". Again, something that POSIX
programs don't expect.


> Moreover, this transparent mapping would also solve the copy/backup probl=
em
> discussed in the other thread (was it "rsync"?) and actually all problems=
 at
> once, like including these things in zip archives etc.

Zip would never know about the ADSs, because they don't show up in
directory listings. Same in cmd.exe, btw.

I guess they could be included in Cygwin directory listings, but
- It would be a chunky piece of work to implement it.
- It would slow down directory operations.
- Non-POSIX behaviours would remain: creating "foo:bar" would create
an empty "foo" and deleting "foo" would also delete "foo:bar" and any
other ADSs.

I think they'd need a special API if they were to be supported. Do
they fit into the xattr stuff?

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

