From d88c87a6db95f45b1bd14f6c248e3109747c7208 Mon Sep 17 00:00:00 2001 From: Steve Suehs Date: Sun, 3 Feb 2013 14:32:24 -0600 Subject: [PATCH] Add a save...interop function. Might be a better way --- nastimer/src/nastimer/core.clj | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nastimer/src/nastimer/core.clj b/nastimer/src/nastimer/core.clj index 8bc54ca..e79b48b 100644 --- a/nastimer/src/nastimer/core.clj +++ b/nastimer/src/nastimer/core.clj @@ -30,6 +30,15 @@ (with-open [r (java.io.PushbackReader. (java.io.FileReader. inputfilename))] (doall (take-while identity (repeatedly (fn [] (read r false nil))))))) +(defn save-nasfiles-interop + "Save a list of nasfiles to a text file." + [nasfiles outputfile] + (binding [*out* (java.io.FileWriter. outputfile)] + (doall + (for [nf nasfiles] + (do (print "#nasfile/file") + (prn { :path (:path nf) :size (:size nf) :moddate (:moddate nf) }) ))))) + (defn scan "Returns a sequence of NasFiles as read from rootToScan."