RosettaCodeData/Task/Fork/Clojure/fork-2.clj
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

7 lines
287 B
Clojure

(let [search (future (shell/sh "find" "." "-name" "needle.*" :dir haystack))]
(while (and (other-stuff-to-do?) (not (future-done? search)))
(do-other-stuff))
(let [{:keys [exit out err]} @search]
(if (zero? exit)
(do-something-with out)
(report-errors-in err))))