graph-util.lisp for Clozure CL on Mac OS X

260 views
Skip to first unread message

HaPeFo

unread,
Feb 3, 2011, 6:16:00 PM2/3/11
to Land of Lisp
I just finished chapter 7. I wanted to stay with CCL, so I tried to
find out how to change the following code to make it work on my
machine.

original code from "dot->png":
(ext:shell (concatenate 'string "dot -Tpng -O " fname))

code for CCL on Mac OS X:
(run-program "bash" '("-c" "dot -Tpng") :input fname :output
(concatenate 'string fname ".png"))

Just in case you're in a similar position and would like to know :-)

Tim Menzies

unread,
Feb 4, 2011, 1:33:52 PM2/4/11
to Land of Lisp
excellent tip. clozure rules!

t

for dot->png in sbcl, see
http://groups.google.com/group/land-of-lisp/browse_thread/thread/4636999e09746173

Pedro B. G. Costa

unread,
Sep 28, 2011, 1:58:55 PM9/28/11
to land-o...@googlegroups.com
The correct line to work with Clozure CL is:

 (run-program "bash" '("-c" "dot -Tpng") 
               :input (concatenate 'string fname ".dot") 
               :output (concatenate 'string fname ".png")))  

FordPrefect

unread,
Feb 12, 2013, 12:18:15 AM2/12/13
to land-o...@googlegroups.com
Thanks for the work with Clozure CL guys, much appreciated.

When I try to run it the bash command I get the following error:

Error: Permission denied : "wizard.dot"
While executing: CCL::%CREATE-FILE, in process Listener(6).

Any ideas on how I get past the permissions error?

Thanks again.

Snorre Svendsen

unread,
Mar 27, 2013, 1:34:43 PM3/27/13
to land-o...@googlegroups.com
Thanks for this, it works!

For some reason, on my setup the bash shell does not search all directories in $PATH  when invoked through CLL:RUN-PROGRAM. The solution was to set the path to "dot" explicitly:

  (run-program "bash" '("-c" "/usr/local/bin/dot -Tpng")
               :input fname
               :output (concatenate 'string fname ".png")))

Now I just have to figure out why run-program does not find programs in all $PATH directories...

-Snorre
Reply all
Reply to author
Forward
0 new messages