This procedure creates a new output port referring to the
system file string
, as does
the procedure
open-output-file
. It then calls the given
thunk
in a dynamic context such that the current output
port is the new output port. If the procedure returns, then the port
will be closed as with close-output-port. If the procedure
does not return, the port will not be closed until and unless
it can be shown (as by the reachability analysis done by the
garbage collector) that the port cannot be used for any
output operations.