I'm writing a routine that need to check if the stream it is writing to is open before it writes to it. for example, before I try to write and error messge to stdout, I want to make sure it is still open. How can I do this? (I remember reading how to somewhere but I can't remember where.) Thanx.