From: Tom Spilman Date: 2001-05-27T00:10:04+09:00 Subject: [ruby-talk:15763] Re: Disabling stderr Actually i've been perusing the source to the ruby parser and found that 'rb_compile_error_append' is called when a compile time error occurs. 'rb_compile_error_append' calls 'err_append' which when in eval mode dumps the error via a call to fputs( s, stderr ). I could try the same technique you described in C to keep ruby from doing this. Tom "J J" wrote in message news:uO6P6.28544$BN6.1414115@newsread1.prod.itd.earthlink.net... > How about: > > nulFile = File.open('nul', 'w') # UNIX: nulFile = > File.open('/dev/null', 'w') > STDERR = nulFile > > etc. > > Trouble is, exceptions don't seem to print to STDERR, or STDOUT. > E.g. > > C:\john\ruby>ruby -e "q=File.open('nul','w'); STDERR=q; STDOUT=q; raise > 'potty'" > > -e:1: warning: already initialized constant STDERR > -e:1: warning: already initialized constant STDOUT > -e:1: potty (RuntimeError) > > Regards, > JJ > > -- > Be Kind, Be Careful, Be Yourself > -- > Solid, reliable software at reasonable prices > http://www.johnjohnsonsoftware.com > > > "Tom Spilman" wrote in message > news:b41P6.14655$CD5.7050932@news2.rdc2.tx.home.com... > > Is there a way to keep Ruby from sending exception info to the stderr > > stream when i've embedded it into my application? Thanks. Tom > > > > > >