chickadee » scheme » open-output-file

(open-output-file filename [mode ...])procedure

Takes a string naming an output file to be created and returns an output port capable of writing characters to a new file by that name. If the file cannot be opened, an error is signalled. If a file with the given name already exists, the effect is unspecified.

Additional mode arguments can be passed in, which should be any of the keywords #:text, #:binary or #:append. #:text and #:binary indicate the mode in which to open the file (this has an effect on non-UNIX platforms only), while #:append indicates that instead of truncating the file on open, data written to it should be appended at the end. The extra mode arguments are CHICKEN extensions to the R5RS standard.