From: ahoward Date: 2002-11-09T07:34:39+09:00 Subject: help - redirect/flush/sync problem rubyists- i thought i understood redirection, untill this: #!/usr/local/bin/ruby $stderr.reopen File.open 'stderr', 'w' $stderr.sync = true $defout.sync = true foo # this raises an exception... $defout.flush $defout.close $stderr.flush $stderr.close puts IO.readlines 'stderr', 'r' i was expecting to see foo.rb:7: undefined local variable or method `foo' for # (NameError) which IS in fact writtne to the file 'stderr', but not untill AFTER the script finishes? what gives? i wanted to use this technique to catch NameErrors errors from cgi scripts... -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ahoward@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================