berkesokhan / rubydotnetcompiler

Automatically exported from code.google.com/p/rubydotnetcompiler
1 stars 0 forks source link

reopen fails on $stdout/$stderr #75

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
$stdout.puts "one"
File.open('tmp.txt','w')  {|f|
  $stdout.reopen(f)               # <-- Ruby.Net fails here
  $stdout.puts "two"
  $stdout.puts "three"
  $stdout.reopen($stderr)
  $stdout.puts "four"
}
IO.readlines('tmp.txt').each {|l|
  puts "> #{l}"
} 

Expected output:
one
four
> two
> three

Actual output:
one

Unhandled Exception: System.NotSupportedException: Stream does not support 
seeking.
   at Ruby.Compiler.AST.SOURCEFILE.ExecuteMain(Assembly Assembly, String[] 
args)
   at Ruby.Compiler.AST.SOURCEFILE.ExecuteMain(PEFile Assembly, String[] 
args)
   at Ruby.Compiler.RubyEntry.Process(String[] args)

Original issue reported on code.google.com by djl.rif...@googlemail.com on 16 Jan 2008 at 2:22