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:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=XCM2d93QQ1CJD0RX
	csDErQi3jBxm7H4BkmIFBIIdUHfzvlEVBGvAxJd3SPCnfYSup4YilkzAs3q7EUQn
	55hVf+oy1KjB1Y7cRpJ/oS66ecThnZ1zcnR9l08alycpxREqC5+bc8L8dSQPg4b1
	jULkFqt8NMsTm5peKUQB/tAbfLQ=
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
	:content-transfer-encoding; s=default; bh=7mLfkgEj32jA2E1sinMCct
	AYJh8=; b=mJSXlctt0UjudroGvPf+srXskQlA/8hUri58oENFmEGYV76Af1NHbb
	TVx1/8rb3NFRrJCm2ae5KiSraR4udVfegeoVr8OvXIoyEpZuEY+wJ+Krsxxz3ahu
	ef+uA0rQ5cr7IUTrp0OcDcKWBjrDka11iPMT3z9FjvDMt5VjqrWBk=
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-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1460, proxy, HContent-Transfer-Encoding:8bit
X-HELO: mail.avenger.ws
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=avenger.ws;	s=ethereal; t=1532134758;	bh=BiOozfM9WYsO+4ieRHHqLSIQtdC8UjDCkraR4WY3gpQ=;	h=Subject:To:References:From:Date:In-Reply-To;	b=OJaxUm/9BcRNtdzBNQvCcpLlce1hxejNOsbHYX1IQryhYtYC51ZnObXzqadNd8m6q	 eMVGrOf/aQ6KSSezpgWIphxVnNOD9u980m1CAzyPoDaTmcxiJflEO+d1jdhErcdqhs	 x5K7sUjpN/QIvHYJWf14MUrnnFORznFL3TAOcpCc=
Subject: Re: Why is stdin always a pipe?
To: cygwin@cygwin.com
References: <CAJ+sA06u+pfPpTeFDQYaaT52c5_yz98i+MaTH28DCJoZkVc7=g@mail.gmail.com> <e61f4fcb-96cd-699b-85b8-314f1ff96e2e@gmail.com> <CAJ+sA06X2dvZtCr7B2rLOH615++eG+s5QsYVg-nOqRd_4HMZyQ@mail.gmail.com> <d9aa837e-a906-784d-d90b-1478c65c19db@SystematicSw.ab.ca>
From: Heavenly Avenger <avenger@avenger.ws>
Message-ID: <6a6289ef-a8fe-9faa-ebf5-04e7a5fbe8c6@avenger.ws>
Date: Fri, 20 Jul 2018 21:59:48 -0300
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <d9aa837e-a906-784d-d90b-1478c65c19db@SystematicSw.ab.ca>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes

My results match Brian Inglis', not João Eiras'. I run cygwin from a 
putty session (using putty's cygtermd little proxy) if that matters.


On 7/20/2018 11:52 AM, Brian Inglis wrote:
> On 2018-07-20 07:17, João Eiras wrote:
>>>> $ [[ -p /dev/stdin ]] && echo pipe || echo nopipe
>>>> nopipe
>> Interesting, it's always a pipe for me. What about ls ?
>>
>> $ ls -l /dev/stdin
>> prw------- 1 user None 0 Jun  4 15:54 /dev/stdin
> Are you using a terminal that does not provide a console interface?
> That is a pipe; Cygwin terms look like this:
>
> $ ll -go /dev/std*; ll -go /proc/self/fd/[012]; ll -go /dev/pty?
> lrwxrwxrwx 1 15 May 14  2013 /dev/stderr -> /proc/self/fd/2
> lrwxrwxrwx 1 15 May 14  2013 /dev/stdin -> /proc/self/fd/0
> lrwxrwxrwx 1 15 May 14  2013 /dev/stdout -> /proc/self/fd/1
> lrwxrwxrwx 1 0 Jul 20 08:18 /proc/self/fd/0 -> /dev/pty0
> lrwxrwxrwx 1 0 Jul 20 08:18 /proc/self/fd/1 -> /dev/pty0
> lrwxrwxrwx 1 0 Jul 20 08:18 /proc/self/fd/2 -> /dev/pty0
> crw--w---- 1 136, 0 Jul 20 08:18 /dev/pty0
> crw--w---- 1 136, 1 Jul 20 08:18 /dev/pty1
> $ for fd in 0 1 2 3; do test -t $fd; echo fd $fd term $?; done
> fd 0 term 0
> fd 1 term 0
> fd 2 term 0
> fd 3 term 1
> $ for f in /dev/{std*,pty?}; do test -p $f; echo file $f pipe $?; done
> file /dev/stderr pipe 1
> file /dev/stdin pipe 1
> file /dev/stdout pipe 1
> file /dev/pty0 pipe 1
> file /dev/pty1 pipe 1
>
> where ptys are terms and are not pipes.
>


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

