X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4C6C7DED.40509@gmail.com>
Date: Wed, 18 Aug 2010 17:42:21 -0700
From: Daniel Colascione <dan.colascione@gmail.com>
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: "run" changes behavior with cygwin-17.6
References: <AANLkTikBTgg9M=xuZ4S2VkNU+Zr=hy3C=_Tr8BPj5baD@mail.gmail.com> <20100818185421.GC22698@ednor.casa.cgf.cx> <20100818191340.GB11340@calimero.vinschen.de> <20100818191906.GD22698@ednor.casa.cgf.cx> <20100818192238.GA27567@ednor.casa.cgf.cx> <20100818193446.GC11340@calimero.vinschen.de> <20100818193940.GA4358@ednor.casa.cgf.cx> <AANLkTi=vy5=E2fGJQ-2=cehaQFvsc-+oYLKp1dc7tVS6@mail.gmail.com> <20100818195546.GF11340@calimero.vinschen.de> <4C6C3B15.2000605@redhat.com> <20100818201921.GI11340@calimero.vinschen.de>
In-Reply-To: <20100818201921.GI11340@calimero.vinschen.de>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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

On 8/18/10 1:19 PM, Corinna Vinschen wrote:
>> POSIX allows the refusal to delete an in-use directory; and Solaris NFS
>> mounts behave this way.

What about renaming directories though? (Damn this tight coupling
Windows has between files and filenames.)

>>  But since Linux can delete in-use directories

Not just Linux -- OS X and the other BSDs too, presumably, allow
renaming and deleting directories that are the CWD of some process.

>> (where an in-use directory includes the condition of at least one
>> process owning that directory as its cwd), and cygwin emulates Linux
>> rather than POSIX, we can try harder if it makes sense.
> 
> That lets me more tend to 3 now (cgf's idea to defer until the first
> chdir).  I'm still chewing nails, though.

IMVHO, #1 is the right choice. It's a lot less surprising than #3, and
it fails safe. It's a very simple model: "relative filename use will
fail unless you do something special, and by doing something special,
you signify that you understand the magic." I can imagine #3 causing
subtle bugs in programs that only chdir() sometimes.

Using Win32 functions in a Cygwin program already requires extra
knowledge; adding CWD tracking doesn't hurt much.

The other crazy idea would be to override the Win32 file and path
functions and handle the notion of a current directory entirely within
Cygwin for both Win32 and Cygwin functions, but IIRC, playing games with
Windows API functions was explicitly rejected a while ago.

--
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

