From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31928 invoked by alias); 15 Jan 2013 08:44:50 -0000 Received: (qmail 29563 invoked by uid 22791); 15 Jan 2013 08:44:18 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Tue, 15 Jan 2013 08:44:10 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id C0789521456; Tue, 15 Jan 2013 09:44:07 +0100 (CET) Date: Tue, 15 Jan 2013 08:44:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: stat() and tilde prefix (was bad bash tab completion) Message-ID: <20130115084407.GA2353@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <5024B4D4.6080409@shaddybaddah.name> <50F395D5.4050201@shaddybaddah.name> <20130114061747.GB16739@ednor.casa.cgf.cx> <20130114100002.GA22039@calimero.vinschen.de> <50F417F9.8040108@shaddybaddah.name> <20130114161307.GB8617@calimero.vinschen.de> <50F47A8B.5050001@cs.utoronto.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <50F47A8B.5050001@cs.utoronto.ca> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2013-01/txt/msg00200.txt.bz2 On Jan 14 16:37, Ryan Johnson wrote: > On 14/01/2013 3:24 PM, Stephan Mueller wrote: > >Perhaps (as you may well have already considered): > > > >- replace the path prefix by the mount point first? (this may be naïve > > on my part, but it's not clear to me that .. early in a path should be able > > to influence which mount point is substituted) > If I mount something at /foo/bar/baz, then /foo/bar/baz/../../blah > definitely shouldn't end up inside baz. > > >- test directory existence of the component preceding .. before collapsing > > (in the example above) b/.. to nothing. > >- trust that for a/b3/b2/b/../../../c, the existence test of a/b3/b2/b > > before collapsing b/.. to nothing implies existence of b2 and b3 so no > > further tests are needed for 'runs' of .. components with enough > > components before them > > > >Understood that this is still going to cause a slowdown because paths with > >.. are not uncommon, but it would reduce the number of additional > >existence checks from one-per-path-component to one-per-run-of-.., > >which means none in the case of paths without .. in them. > The rest seems totally reasonable to me, FWIW. That's a chicken/egg-like situation. To be able to convert the POSIX path prefix (aka mount point) to the matching DOS path prefix, the path has to be normalized. But without being converted to a DOS path, you can't check path components. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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