[#8530] Enumerable and rand — Koretsugu Daigoro <tmmcross@...>

これつぐです。

21 messages 1999/12/05
[#8534] Re: Enumerable and rand — matz@... (Yukihiro Matsumoto) 1999/12/06

まつもと ゆきひろです

[#8581] Re: [ruby-list:19228] Ruby 1.4.3 — Katsuyuki Komatsu <komatsu@...>

小松です。

19 messages 1999/12/07
[#8592] Re: [ruby-list:19228] Ruby 1.4.3 — matz@... (Yukihiro Matsumoto) 1999/12/07

まつもと ゆきひろです

[#8645] urllib and httplib — TAKAHASHI Masayoshi <maki@...>

高橋征義です。

47 messages 1999/12/14
[#8646] Re: urllib and httplib — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/12/14

なひです.

[#8653] Re: urllib and httplib — matz@... (Yukihiro Matsumoto) 1999/12/14

まつもと ゆきひろです

[#8656] Re: urllib and httplib — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/12/15

なひです.

[#8659] Re: urllib and httplib — Wakou Aoyama <wakou@...> 1999/12/15

青山です。

[#8685] Re: urllib and httplib — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/12/21

なひです.

[#8687] Re: urllib and httplib — TAKAHASHI Masayoshi <maki@...> 1999/12/21

高橋征義です。

[#8690] Re: urllib and httplib — matz@... (Yukihiro Matsumoto) 1999/12/21

まつもと ゆきひろです

[#8717] Re: urllib and httplib — TAKAHASHI Masayoshi <maki@...> 1999/12/24

高橋征義です。

[#8963] Re: urllib and httplib — "NAKAMURA, Hiroshi" <nakahiro@...> 2000/01/19

なひです.

[#8650] [PATCH] Ruby/Tk — Koji Arai <JCA02266@...>

新井です。

20 messages 1999/12/14
[#8651] Re: [PATCH] Ruby/Tk — Koji Arai <JCA02266@...> 1999/12/14

新井です。

[#8692] [win] dir name — KANEKO Naoshi <wbs01621@...>

金子です。

22 messages 1999/12/21
[#8695] Re: [win] dir name — Koji Oda <oda@...1.qnes.nec.co.jp> 1999/12/22

小田@QNES です。

[#8741] Re: [ruby-list:19945] Re: array + empty string — Wakou Aoyama <wakou@...>

青山です。

18 messages 1999/12/27
[#8743] Re: [ruby-list:19945] Re: array + empty string — matz@... (Yukihiro Matsumoto) 1999/12/28

まつもと ゆきひろです

[#8742] [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — Kazunori NISHI <kazunori@...>

西@九大です。

64 messages 1999/12/27
[#8744] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — matz@... (Yukihiro Matsumoto) 1999/12/28

まつもと ゆきひろです

[#8748] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — Kazunori NISHI <kazunori@...> 1999/12/28

西@九大です。

[#8751] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — matz@... (Yukihiro Matsumoto) 1999/12/28

まつもと ゆきひろです

[#8767] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — Kazunori NISHI <kazunori@...> 1999/12/29

西@九大です。

[#8777] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — matz@... (Yukihiro Matsumoto) 1999/12/30

まつもと ゆきひろです

[#8791] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — Minero Aoki <aamine@...> 1999/12/31

あおきです。

[#8792] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — matz@... (Yukihiro Matsumoto) 1999/12/31

まつもと ゆきひろです

[#8793] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — ARIMA Yasuhiro <fit0298@...> 1999/12/31

有馬です。

[#8795] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — Akinori MUSHA aka knu <knu@...> 1999/12/31

 knuです。

[#8798] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — matz@... (Yukihiro Matsumoto) 2000/01/01

まつもと ゆきひろです

[#8811] Re: [REQ] Array#each{|a,b,...|}, Array#shift/pop(num) — Akinori MUSHA aka knu <knu@...> 2000/01/03

 knuです。

[ruby-dev:8702] Re: [mswin32] STDERR does not work during `_function.

From: KANEKO Naoshi <wbs01621@...>
Date: 1999-12-22 15:19:00 UTC
List: ruby-dev #8702
金子です。

In message "[ruby-dev:8665] [mswin32] STDERR does not work during `_function."
    on Wed, 15 Dec 1999 21:09:54 +0900, "NAKAMURA, Hiroshi" <nakahiro@sarion.co.jp> writes:

>なひです.
>
>mswin版のRubyで「`」でコマンドを実行した際,
>標準エラーへの出力がどこかへ消えてしまうようです.
>報告だけですいません...

プロセスを起動するとき、標準エラーハンドルが正しくセットされて
いなかったようです。
入力をパイプにつなげる場合のハンドルも間違っていました。

ついでに余分と思われた DuplicateHandle() もまとめて消してしまい
ましたが、どうでしょうか。これも深い意味があったりして。
...だんだん自信がなくなってきました。

一応、NT4.0 では動くことを確認しました。
ただし、Win98 ではプロセス呼び出しのあたりはいろいろおかしくて
(今回の修正とは関係なく)テストしてると簡単にアプリケーション
エラーになります。
こんなのとか。

f = open("|./cat.exe", "w")
f.puts("hello")
f.close

もう少し調べてみる必要がありそうですね。


===============================================================
diff -u -p win32/win32.c.orig win32/win32.c 
--- win32/win32.c.orig	Sun Dec 19 22:46:25 1999
+++ win32/win32.c	Tue Dec 21 00:36:49 1999
@@ -495,7 +495,7 @@ mypopen (char *cmd, char *mode) 
 		int p[2];
 
 		BOOL fRet;
-		HANDLE hInFile, hOutFile, hStdin, hStdout;
+		HANDLE hInFile, hOutFile;
 		LPCSTR lpApplicationName = NULL;
 		LPTSTR lpCommandLine;
 		LPTSTR lpCmd2 = NULL;
@@ -533,35 +533,14 @@ mypopen (char *cmd, char *mode) 
 		aStartupInfo.dwFlags    = STARTF_USESTDHANDLES;
 
 		if (reading) {
-			aStartupInfo.hStdInput  = GetStdHandle(STD_OUTPUT_HANDLE);//hStdin;
-			aStartupInfo.hStdError  = INVALID_HANDLE_VALUE;
-			//for save
-			DuplicateHandle(GetCurrentProcess(), GetStdHandle(STD_OUTPUT_HANDLE),
-			  GetCurrentProcess(), &hStdout,
-			  0, FALSE, DUPLICATE_SAME_ACCESS
-			);
-			//for redirect
-			DuplicateHandle(GetCurrentProcess(), GetStdHandle(STD_INPUT_HANDLE),
-			  GetCurrentProcess(), &hStdin,
-			  0, TRUE, DUPLICATE_SAME_ACCESS
-			);
+			aStartupInfo.hStdInput  = GetStdHandle(STD_INPUT_HANDLE);
 			aStartupInfo.hStdOutput = hOutFile;
 		}
 		else {
-			aStartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); //hStdout;
-			aStartupInfo.hStdError  = INVALID_HANDLE_VALUE;
-			// for save
-			DuplicateHandle(GetCurrentProcess(), GetStdHandle(STD_INPUT_HANDLE),
-			  GetCurrentProcess(), &hStdin,
-			  0, FALSE, DUPLICATE_SAME_ACCESS
-			);
-			//for redirect
-			DuplicateHandle(GetCurrentProcess(), GetStdHandle(STD_OUTPUT_HANDLE),
-			  GetCurrentProcess(), &hStdout,
-			  0, TRUE, DUPLICATE_SAME_ACCESS
-			);
-			aStartupInfo.hStdInput = hInFile;
+			aStartupInfo.hStdInput  = hInFile;
+			aStartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
 		}
+		aStartupInfo.hStdError  = GetStdHandle(STD_ERROR_HANDLE);
 
 		dwCreationFlags = (NORMAL_PRIORITY_CLASS);
 
@@ -587,24 +566,12 @@ mypopen (char *cmd, char *mode) 
 		CloseHandle(aProcessInformation.hThread);
 
 		if (reading) {
-			HANDLE hDummy;
-
 			fd = _open_osfhandle((long)hInFile,  (_O_RDONLY | pipemode));
 			CloseHandle(hOutFile);
-			DuplicateHandle(GetCurrentProcess(), hStdout,
-			  GetCurrentProcess(), &hDummy,
-			  0, TRUE, (DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)
-			);
 		}
 		else {
-			HANDLE hDummy;
-
 		    fd = _open_osfhandle((long)hOutFile, (_O_WRONLY | pipemode));
 			CloseHandle(hInFile);
-			DuplicateHandle(GetCurrentProcess(), hStdin,
-			  GetCurrentProcess(), &hDummy,
-			  0, TRUE, (DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)
-			);
 		}
 
 		if (fd == -1) 
===============================================================


-- 
金子 尚史 (KANEKO Naoshi)
e-mail: wbs01621@mail.wbs.ne.jp


In This Thread