Re: System calls

2010-08-09 Thread Dave
Thanks jf, that worked: (ns msms (:gen-class) (:use [clojure.contrib.shell-out :only (sh)])) (defn get-msms-pts-OSX [{pdb-file :pdb-file density :density radius :radius :as all :or {density 1.0 radius 1.5}}] (if (contains? all :pdb-file) (sh bash :in (str

Re: System calls

2010-08-09 Thread Mike Meyer
On Mon, 9 Aug 2010 09:37:14 -0700 (PDT) Dave david.dreisigme...@gmail.com wrote: Thanks jf, that worked: (ns msms (:gen-class) (:use [clojure.contrib.shell-out :only (sh)])) (defn get-msms-pts-OSX [{pdb-file :pdb-file density :density radius :radius :as all :or {density 1.0

Re: System calls

2010-08-07 Thread j-g-faustus
On Aug 7, 7:27 am, Meikel Brandmeyer m...@kotka.de wrote: (defn to-env   [env-vars-map]   (- env-vars-map     (map #(str (name (key %)) = (val %)))     into-array)) And an invocation: user= (to-env {:PATH /bin:/usr/bin :HOME /Users/mb :foo bar}) #String[] [Ljava.lang.String;@58c16b18

Re: System calls

2010-08-07 Thread Dave
Thanks everyone. I have already tried the full path: (defn get-msms-pts-OSX ;; Finds the msms points for a density (optional DEFAULT = 1.0) and radius (optional DEFAULT = 1.5) [pdb-file density radius] (execute (str /Users/daviddreisigmeyer/msms_MacOSX_2.6.1/ pdb_to_xyzr pdb-file

Re: System calls

2010-08-07 Thread j-g-faustus
On Aug 7, 4:46 pm, Dave david.dreisigme...@gmail.com wrote:   (execute (str /../pdb_to_xyzr pdb-file /..))) Here it seemed to run (the above error isn't shown) but nothing happened and the REPL become unresponsive again.   I think the issue is that Runtime.exec doesn't start a shell, just

System calls

2010-08-06 Thread Dave
I having some trouble with system calls using clojure (actually a whole lot more than that but this is the current day's difficulty). Below, test-execute works, but get-msms-pts-OSX seems to hang, as in nothing happens and the REPL is unresponsive afterwards. If I run the output of the (str

Re: System calls

2010-08-06 Thread Dave
Also, this only shows the 2nd call (with ls-arg2): (defn test-execute [ls-arg1 ls-arg2] (execute (str ls - ls-arg1)) (execute (str ls - ls-arg2))) so maybe the difficulty above is some problem with how the multiple system calls are performed. If I only use this: (defn get-msms-pts-OSX

Re: System calls

2010-08-06 Thread j-g-faustus
On Aug 7, 5:06 am, j-g-faustus johannes.fries...@gmail.com wrote: I don't think there's a direct way to create a String array in Clojure Correction - there is: (into-array String [a b]) jf -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: System calls

2010-08-06 Thread Meikel Brandmeyer
Hi, Am 07.08.2010 um 05:06 schrieb j-g-faustus: I don't think there's a direct way to create a String array in Clojure (defn to-env [env-vars-map] (- env-vars-map (map #(str (name (key %)) = (val %))) into-array)) And an invocation: user= (to-env {:PATH /bin:/usr/bin :HOME

Re: System calls

2010-08-06 Thread Adrian Cuthbertson
:) (inc :)) On Sat, Aug 7, 2010 at 7:27 AM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 07.08.2010 um 05:06 schrieb j-g-faustus: I don't think there's a direct way to create a String array in Clojure (defn to-env  [env-vars-map]  (- env-vars-map    (map #(str (name (key %)) = (val