# close
Close a channel opened with `open`.
## Syntax
[close $chan]
## Parameters
- `$chan` — Channel handle returned by `open`.
## Examples
set chan [open "/tmp/log.txt" "w"] [puts $chan "done"] [close $chan] # => true [close $chan] # => false (already closed)
## Returns
`true` if this call closed the channel, `false` if it was already
closed. Closing is idempotent.
Standard streams (`:stdin`, `:stdout`, `:stderr`) cannot be closed —
passing one raises an error. Dropped channels are also closed by the GC,
so an explicit `close` is a courtesy rather than a requirement.
## See Also
`open`, `gets`, `puts`