Project

General

Profile

Actions

Bug #2549

closed

Redirected stdout don't work on child process on Windows

Added by phasis68 (Heesob Park) about 14 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
ruby -v:
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]
[ruby-core:27376]

Description

=begin
A file created in Ruby and redirected to stdout don't work properly on child process in 1.9.x.

c:\work>type test.rb
STDOUT.reopen(File.open('out.txt', 'w+'))
system('ruby -v')
File.open('out.txt','a+'){|f|f.puts('EOF')}

In 1.8.6
c:\work>type out.txt
ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]
EOF

In 1.9.1p243 and 1.9.2dev
c:\work>type out.txt
EOF

I noticed the root cause is FILE_FLAG_OVERLAPPED handling of
ruby 1.9.x. I guess it is related with the select and native thread supporting
on Windows. But the child process cannot handle the overlapped
I/O on most cases.

In short, the inheritable file handle must not opened with the
FILE_FLAG_OVERLAPPED flag.

Regards,
Park Heesob
=end


Related issues 1 (0 open1 closed)

Is duplicate of Backport191 - Bug #2510: xsystem fails in 1.9/mingwClosedusa (Usaku NAKAMURA)12/22/2009Actions
Actions #1

Updated by usa (Usaku NAKAMURA) almost 14 years ago

  • Status changed from Open to Closed

=begin
fixed at r27449
=end

Actions

Also available in: Atom PDF

Like0
Like0