public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Subject: Re: tee: 'standard output': Permission denied
Date: Wed, 30 Dec 2020 19:13:09 +0900	[thread overview]
Message-ID: <20201230191309.ea33fb623b88392b829f8ad8@nifty.ne.jp> (raw)
In-Reply-To: <1798147396.20201230052402@inbox.ru>

On Wed, 30 Dec 2020 05:24:02 +0300
Andry wrote:
> Hello takashi,
> 
> >I cannot reproducue your problem even with chcp.com 65001 and
> >start "" cmd.exe ...
> Seems this is a bug specifically for the Windows 7 x64.

I guess the problem is essentially the same with followings.

In Win7,
1) Start command prompt.
2) Run chcp 65001
3) Change the font of command prompt to raster font.
4) Run c:\cygwin\bin\printf "\xce\b1\n"

This causes the error:
/usr/bin/printf: write error

What weird is that if the font is other than raster font,
this error does not occur.

I looked into this problem and found that the following
simple c code does not work in command prompt with chcp
65001 and raster font in Win7.

/* Compile this code using MinGW compiler
   and run in cmd.exe */
#include <windows.h>
#include <stdio.h>

int main()
{
    wchar_t wstr[] = L"α\r\n";
    HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
    DWORD n;
    int ret = WriteConsoleW(h, wstr, wcslen(wstr), &n, NULL);
    printf("n=%d, ret=%d, Err=0x%08x\n", n, ret, GetLastError());
    return 0;
}

This is also reproducible in legacy console mode of windows10.

The error code is 0x0000001f (ERROR_GEN_FAILURE: A device attached to
the system is not functioning).

Is this possibly a bug of windows?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

  parent reply	other threads:[~2020-12-30 10:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27  2:04 Andry
2020-12-29 21:50 ` Andry
2020-12-30  1:29   ` Kevin Schnitzius
2020-12-30  2:22     ` Andry
2020-12-30 19:21       ` Brian Inglis
2020-12-31 16:33         ` Andry
2020-12-30  1:31   ` Doug Henderson
2020-12-30  1:45   ` Takashi Yano
2020-12-30  2:24     ` Andry
2020-12-30  4:02       ` Takashi Yano
2020-12-30  4:40         ` Takashi Yano
2020-12-30  4:54           ` Andry
2020-12-30  5:11           ` Andry
2020-12-30  4:49         ` Andry
2020-12-30  5:03           ` Takashi Yano
2020-12-30  5:18             ` Andry
2020-12-30  6:40             ` Takashi Yano
2020-12-30 10:13       ` Takashi Yano [this message]
2020-12-30 15:07         ` Andry

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=20201230191309.ea33fb623b88392b829f8ad8@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --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).