public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Linda Walsh <cygwin@tlinx.org>
To: cygwin@cygwin.com
Subject: Re: /dev/stderr problem
Date: Mon, 17 Oct 2016 18:29:00 -0000	[thread overview]
Message-ID: <580511C4.3050007@tlinx.org> (raw)
In-Reply-To: <1957a989-fe56-ca68-ddc2-83bc59480ccd@redhat.com>

Eric Blake wrote:
> On 10/17/2016 01:32 AM, Thorsten Kampe wrote:
>> * Thorsten Kampe (Mon, 17 Oct 2016 08:25:13 +0200)
>>
>>> the following bash script results in a different output when 
>>> redirected to a file.
>>>
>>> ```
>>> printf "FIRST LINE\n" > /dev/stderr
>>> shopt -os xtrace
>>> printf "SECOMD LINE\n" > /dev/stderr
> 
> Cygwin treats '> /dev/stderr' as a request to truncate /dev/stderr (or,
> for that matter, any opening of a file under /proc/self/fd).  Other
> platforms treat that as a special file that can never be truncated, but
> is instead reopened at the same offset.
> 
> Maybe cygwin can be taught that opening a file through /proc/self/fd
> should preserve rather than reset offsets, but it will be a tricky
> patch, and someone has to write it.
---
Is /dev/stderr a POSIX special name that one should expect that rewinding
is disallowed or ignored?

Good analysis, BTW, that sure would have puzzled me.
-l


> 

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

      reply	other threads:[~2016-10-17 18:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17  6:34 Thorsten Kampe
2016-10-17 13:51 ` Thorsten Kampe
2016-10-17 18:11   ` Eric Blake
2016-10-17 18:29     ` Linda Walsh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=580511C4.3050007@tlinx.org \
    --to=cygwin@tlinx.org \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).