From: Tim Bates Date: 2004-05-04T07:58:42+09:00 Subject: Re: $SAFE = 3.5? Mark Hubbart wrote: > Safe.level(2) do > # unsafe code here > end class Safe def level(lvl) th = Thread.new do $SAFE = lvl.to_i yield end th.join end end Does exactly what you'd expect. Also, for the original poster's question: one way around the problem is to use a setup like the one above, and have the SAFE thread pass the content to be written out to another, non-SAFE thread which can sanity check it and then write it to the IO. If you're still confused I could dig up some code where I did some playing around with something like this once. Tim. -- Tim Bates tim@bates.id.au