Created
January 26, 2010 14:56
-
-
Save jcromartie/286894 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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