X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=IV/E eL3GYWWGoUT/xnCHITZKhyXOJrLTo2S92DepMQLIUMQK1S7PfqdU3UYr9r76ASAn SjzNYjX8GiCTxtG/UJxn7xhus5JuQ92+j7a/odrRoKvDAZh9Kywmx306vmQvrPKn AbSjskx9ZR5z5fnf/vSIOEmsO4A8iSSWBKzdRu4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=9ClnVh9sqd h6SolP2N9L6zZ2yh4=; b=RW+wSjCKeMe4Q2OioLQoNIMRPVfhnQHUgdljeXuxYI 9F8Ln/C40KnrkWBrjICT/GTN/8xrHz9xzNxV0p2P6XswF+m5jcYMY7ISl9gYrUJg GW6pkmudz+IsJu+2yyDgsxmzxYARv8Do9ErDx29KPCSUvyE+4/S/d3/V1NGCUgre w= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,NORMAL_HTTP_TO_IP,NUMERIC_HTTP_ADDR,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=lean, letter, act X-HELO: mx1.redhat.com Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ... To: cygwin AT cygwin DOT com References: From: Eric Blake Openpgp: preference=signencrypt Message-ID: <27047198-dba4-091b-8235-fc9150b68fbe@redhat.com> Date: Wed, 28 Aug 2019 08:33:05 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JAa6gHNQmyVgoKcNy3KELaWmf7TzhYogq" X-IsSubscribed: yes --JAa6gHNQmyVgoKcNy3KELaWmf7TzhYogq Content-Type: multipart/mixed; boundary="vstSVYcFdmml9TmEhVWKfMoF8nQRfduYy"; protected-headers="v1" From: Eric Blake To: cygwin AT cygwin DOT com Message-ID: <27047198-dba4-091b-8235-fc9150b68fbe AT redhat DOT com> Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ... References: In-Reply-To: --vstSVYcFdmml9TmEhVWKfMoF8nQRfduYy Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/27/19 7:51 AM, Houder wrote: >=20 > 64-@@ mkdir 'e:\' # creates subdirectory e: !!!!! Had you typed: mkdir 'e:/' I would expect subdirectory ./e: to be created. But with 'e:\', that is a DOS style path, so I would lean towards requiring './e:\' if you want to create a literal directory named 'e:\', but without the leading ./ to merely treat 'e:\' as the drive letter and failing with EEXIST because /cygdrive/e already exists. So it sounds like mkdir() could be further improved when something ends in \ rather than in /. (The behavior when ending in / should not be changed, though). > 64-@@ rmdir 'e:\' # fails, because it refers to /drv/e > rmdir: failed to remove 'e:\': Directory not empty That matches what I would expect - because you did not pass a leading './', but used a backslash, you used a DOS style path and should be attempting to act on /cygdrive/e. >=20 > 64-@@ rmdir 'e:' This, however, is not a DOS path, so it should prefer to act on './e:' if that exists (and only if it does not exist, then we might consider ALSO seeing if /cygdrive/e exists before giving up completely). >=20 > Yes, I should NOT use "DOS paths" ... >=20 > =C2=A0=C2=A0=C2=A0 https://cygwin.com/cygwin-ug-net/using.html#pathnames-= win32 >=20 > However, I wonder why e:\ is interpreted by mkdir as e:, and as > /drv/e (that is as e:\) by rmdir. mkdir 'e:/' is supposed to be identical to mkdir 'e:'. The problem is that because we interchange \ with / in a number of places, we have accidentally ended up with mkdir 'e:\' behaving like mkdir 'e:/' instead of acting on the DOS path. Patches welcome. --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org --vstSVYcFdmml9TmEhVWKfMoF8nQRfduYy-- --JAa6gHNQmyVgoKcNy3KELaWmf7TzhYogq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAl1mgpEACgkQp6FrSiUn Q2olywf/RL2numGPWoFvO4Z7mPZ0KBdw3giWfb/JmQiQHBjNkyVpzKwE4tbGStt1 yY2y07hWQ2IhMQrZURcjXIiGHLQcHf6u6blt3Xg2V8VMB7WRh68PwovzpMZSK+6U 51Om5LIX3TzJKNrmGSQxakDzbdUMVLTjMgdxLK9NFbn7b9J+JgXsKmnBGCxcnhoh xPL0bER04DdKU/D6Iu0NESCWCL4YsXokAX8A7yU/96IDT14b+d6PancfMdYEcSau CeJjHcv1cvn7vdxI71T2xTAvDTnJ6ySOYC7oBlQIQ13ZE9kL+FOdcwR8/Jl5LBN/ QuQKKwm+/eLmQebk5+P3oA3cnW+SaA== =L2Q0 -----END PGP SIGNATURE----- --JAa6gHNQmyVgoKcNy3KELaWmf7TzhYogq--