4

The following snippter:

(binding [*out* (writer "foo.txt")]
  (pprint models))

Will truncate the output at exactly 208Kb. However the following:

(spit "foo.txt"
      (with-out-str
        (pprint models)))

Works fine and doesn't truncate the output.

Why is this?

4

1 回答 1

4

Sound like a buffer flush issue, try this:

(binding [*out* (writer "foo.txt")]
  (pprint models)
  (flush))

flush will flush the output stream buffers.

于 2013-04-10T08:39:07.193 回答