On Tue, Jul 9, 2019 at 10:35 AM Vikram Shaw <shawvikra...@gmail.com> wrote:

> I want to create a Brl-cad project using Clojure programming language in
> which I can create a database and some solid figure like sphere.
> I have written the code using ``sh`` clojure function but getting error.
> The ``sh`` function is working fine as I have checked in repl.
> This is the code I'm using:
> *(ns brl-cad.core*
> *(:require [clojure.java.shell :refer [sh]]))*
>
> *(defn example []*
> *(println (:out (sh "-c" "./mged" "test.g"))))*
>
> I have added the mged path also: 
> */usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:Applications/BRL-CAD\
> \:\ MGED\ 7.24.0.app/Contents/Resources/rel-7.24.0/bin:/opt/X11/bin*
>
> Error which I'm getting: *Execution error (IOException) at
> java.lang.ProcessImpl/forkAndExec (ProcessImpl.java:-2).*
> *error=2, No such file or directory*
>
> I am using Mac OSX.
> I'm having problem with creating database and solid figure like sphere.
>

Hi,

This doesn't seem to be a Clojure-specific question or a question about
"creating a database and a solid figure".

You are trying to run mged binary, but it's not in the current directory of
the process that runs your Clojure program apparently.

If it's on the PATH, then you should run it w/o prefixing the command with
"./" (this instructs to look in the current directory and ignores the
search paths).  If the mged binary is installed at "/Applications/BRL-CAD\
\:\ MGED\ 7.24.0.app/Contents/Resources/rel-7.24.0/bin" on your system,
then you should make sure to include the leading forward slash in your PATH
definition for it to be found.

I would recommend trying to make it work outside of your Clojure program
first, before trying to run it with functions from clojure.java.shell
namespace.

Cheers,
--
Alex

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CACACo5SNpqTnhgd8OR61XgKaV7BovMGyR6AMS30XSSKjEBNnww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to