I
Iñaki Baz Castillo
Hi, how could I know if $stderr has been redirected to /dev/null?
This is, imagine a program does:
$stderr.reopen "/dev/null"
And later I want to check if it's redirected to /dev/null or not.
I've found a method which could work:
irb $stderr.inspect
"#<IO:/dev/null>"
So I could parse the resulting string. However it doesn't seem a very "cool=
"=20
approach. Is there any there any other more ellegant way?
Thanks a lot.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>
This is, imagine a program does:
$stderr.reopen "/dev/null"
And later I want to check if it's redirected to /dev/null or not.
I've found a method which could work:
irb $stderr.inspect
"#<IO:/dev/null>"
So I could parse the resulting string. However it doesn't seem a very "cool=
"=20
approach. Is there any there any other more ellegant way?
Thanks a lot.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>