close_writer


close_reader(s)
      

If the output stream s is not already closed, close it and return void. Once a stream is closed, no more 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 can be safely reclaimed by the garbage collector.

Examples:


// writing a text file:
let f = file_writer("hello.txt")
write_chars("hello, world", f)
close_writer(f)
      

Also see:

close_reader
is_writer


Core Module Index | Contents