close

action

Syntax
close stream-name indexer? (and stream-name indexer?)*


Purpose

The close action explicitly closes a stream. Once a stream that is attached to a file, buffer, referent, markup parser, or external string sink function has been closed, the same stream name can be used to open another attachment.

Streams don't normally need to be closed because:

  • they are closed automatically when the scope of the stream variable ends, and
  • they are closed automatically if another open is performed on the stream variable.

Several streams can be closed at once.

It is an error to close a stream that is part of any #current-output for any currently open rule or function.

The following syntactic variation is permitted:

  • "&" can be used in place of the keyword and.

Related Syntax