X-Recipient: archive-cygwin@delorie.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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=tGVS+3cHKK9/2kzX
	oKmQHCQMt++4+h5s38CD6OS9C6LdiW2oiam5s/KUL9feb4czQS/O/QaF4bWgMGN4
	xvpSulEJWKBxLCr83SFQbH0PvGpmTuQtl1RAVAkZcrzyj1JW+SVT0x576Qm0FTDm
	oVnEP0tnzOprL+kikjcP3UkZ1W0=
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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=Tf3yxo+n0puheBAQH7C7Uj
	6iLR8=; b=ZyaVFkWiqxQ1Jdj6B5sgcqKi7CSLClC4VrgHtTGpD+t0dz+s13Ycf7
	fgWChe1Dw555/t5cfT4+Hj0apJfDODZ63xdhCqy8/BZKJJ2sJ9H3+49Cvv0SJFmb
	F0tESY1RohTqTBfoA9fFo1MNm0PUobR1Djk/EfbHPyglaPC3DUaYM=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=3.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2
X-HELO: smtpback.ht-systems.ru
Date: Tue, 9 Sep 2014 18:41:16 +0400
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <578633905.20140909184116@yandex.ru>
To: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder@niaid.nih.gov>,
        cygwin@cygwin.com
Subject: Re: latest cygwin: 'run' problem
In-Reply-To: <6CF2FC1279D0844C9357664DC5A08BA20EBC4B75@MLBXV06.nih.gov>
References: <87a96hrki4.fsf@Rainer.invalid> <54060378.2070108@gmail.com>      <5406680D.4030105@verizon.net> <540761FA.1040902@verizon.net>   <87ppfcqyc7.fsf@Rainer.invalid> <540A600A.6090201@verizon.net>   <540A6817.9080207@verizon.net> <20140906201229.GA9220@phoenix>   <20140908174606.GA4187@phoenix> <1448944831.20140909024857@yandex.ru>   <20140909011413.GC4187@phoenix> <836662195.20140909170801@yandex.ru>  <6CF2FC1279D0844C9357664DC5A08BA20EBC4B75@MLBXV06.nih.gov>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Buchbinder, Barry (NIH/NIAID) [E]!

> Andrey Repin sent the following at Tuesday, September 09, 2014 9:08 AM
>>That makes little sense. Could be solved, though. CMD doesn't offer a
>>way to distinguish between file and directory, but we have test.

> Every directory contains a virtual file named nul (note: only one L;
> serves the function of /dev/null ), so one can test for that.

> c:\> if exist c:\Windows\nul echo y
> y

> c:\> if exist c:\Windows\explorer.exe\nul echo y

> c:\>

NUL (or NUL:) is a DOS device. You CAN create a file called nul, though. But even then, the test fails.

$ VER & IF EXIST "%SystemRoot%\nul" ( ECHO y ) ELSE ( ECHO n )

Microsoft Windows [Version 6.1.7601]
n

$ ECHO. > "\\.\%SystemRoot%\nul"
$ DIR /B "%SystemRoot%\n*"
nul
notepad.exe
$ IF EXIST "%SystemRoot%\nul" ( ECHO y ) ELSE ( ECHO n )
n

However, you can test for "%~f1\*". But since the behavior is not documented, you can't rely on such test either.


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 09.09.2014, <18:22>

Sorry for my terrible english...


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

