A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
2
Task/Fork/Clojure/fork-1.clj
Normal file
2
Task/Fork/Clojure/fork-1.clj
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(require '[clojure.java.shell :as shell])
|
||||
(shell/sh "echo" "foo") ; evaluates to {:exit 0, :out "foo\n", :err ""}
|
||||
7
Task/Fork/Clojure/fork-2.clj
Normal file
7
Task/Fork/Clojure/fork-2.clj
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
(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))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue