is attached

operator

Return type:
Switch
Returns:
true if the stream is attached to a destination and false otherwise. Replacing is with isnt will reverse the result.
Syntax
stream-name (is | isnt) attached 

or

#current-output (is | isnt) attached 

or 

#current-input (is | isnt) attached 
    


Purpose

is attached is a a stream test used to determine whether a stream is attached to a destination.

Usage Notes

A stream can have three states:

  • unattached, the initial state,
  • opened, or
  • closed.

When a stream is attached, its destination can be any one of five types:

The is attached test can also be applied to #current-input, to determine when #current-input can supply data to a string sink or markup sink.

Related Concepts