Check output device is a terminal: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
Thundergnat (talk | contribs) m (Fix Perl 6 -> Raku calling conventions) |
||
Line 395: | Line 395: | ||
{{works with|Rakudo|2015.12}} |
{{works with|Rakudo|2015.12}} |
||
The .t method on a filehandle tells you whether it's going to the terminal. Here we use the note function to emit our result to standard error rather than standard out. |
The .t method on a filehandle tells you whether it's going to the terminal. Here we use the note function to emit our result to standard error rather than standard out. |
||
<pre>$ |
<pre>$ raku -e 'note $*OUT.t' |
||
True |
True |
||
$ |
$ raku -e 'note $*OUT.t' >/dev/null |
||
False</pre> |
False</pre> |
||