Skip to content

clojure.core/spit

View this page on ClojureDocs

Type: function Added: Clojure 1.2 Examples: 6 Runnable: 1
([f content & options])

Opposite of slurp. Opens f with writer, writes content, then closes f. Options passed to clojure.java.io/writer.

Examples

by pkolloch on . May have evaluation errors.
by megapatch on . May have evaluation errors.
by jafingerhut on
by ibercode on . May have evaluation errors.
by messinm on . May have evaluation errors.
by Kaspazza on . May have evaluation errors.

Note by flyboarder

The only valid options for spit are :append and :encoding.

Note by didibus

Valid options include:

:append    true to open stream in append mode
:encoding  string name of encoding to use, e.g. \"UTF-8\".

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.