Actions
Bug #2549
closedRedirected stdout don't work on child process on Windows
Status:
Closed
Assignee:
-
ruby -v:
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]
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
Updated by usa (Usaku NAKAMURA) almost 14 years ago
- Status changed from Open to Closed
=begin
fixed at r27449
=end
Actions
Like0
Like0