Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(ns atomic-spit
(:use clojure.contrib.duck-streams))
(defn atomic-spit [path data]
(let [temp (File/createTempFile "spit" nil)]
(spit temp data)
(.renameTo temp (File. path))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.