close_stream


close_stream(s)
      

If the stream s is not already closed, close it and return void. Before closing any buffered bytes or characters are flushed to the underlying stream if the stream is a writer. Once a stream is closed, no more input or output operations may be performed on it. Because the operating system may place limits on the number of file streams open at one time or restrict access to an open file, it is good practice to close any file stream that will no longer be used for input or output. Closing a stream that has already been closed has no effect.

Closing a string or byte array stream has no effect. As they consume no system resources, string and byte array streams are safely reclaimed by the garbage collector.

Also see:

close_writer
close_reader
flush_writer
file_stream
string_reader
string_writer
byte_array_reader
byte_array_writer


Core Module Index | Contents