From: ts Date: 2002-11-10T02:26:53+09:00 Subject: Re: help - redirect/flush/sync problem >>>>> "a" == ahoward writes: a> i think the problem is that NameError does not subclass StandardError, because a> this *does* work : No, not really a> rescue NameError => err a> $stderr.puts err This time you have caught the exception Try with this pigeon% cat b.rb #!/usr/bin/ruby begin $stderr.reopen File.open 'stderr', 'w' $stderr.sync = true 1/0 ensure $stderr.flush puts IO.readlines 'stderr' end pigeon% pigeon% b.rb pigeon% pigeon% cat stderr ./b.rb:5:in `/': divided by 0 (ZeroDivisionError) from ./b.rb:5 pigeon% Guy Decoux