Skip to content

Instantly share code, notes, and snippets.

@d9k
Forked from codification/proc.clj
Created April 9, 2015 03:10
Show Gist options
  • Save d9k/7cd9db30a117c40e5a5f to your computer and use it in GitHub Desktop.
Save d9k/7cd9db30a117c40e5a5f to your computer and use it in GitHub Desktop.
;; original @link https://gist.github.com/codification/1984857
(ns proc
(:import [java.lang ProcessBuilder])
(:use [clojure.java.io :only [reader writer]]))
(defn spawn [& args]
(let [process (-> (ProcessBuilder. args)
(.start))]
{:out (-> process
(.getInputStream)
(reader))
:err (-> process
(.getErrorStream)
(reader))
:in (-> process
(.getOutputStream)
(writer))
:process process}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment