0

Okay i'm trying to make ChucK available in exported Processing sketches, i.e. if i export an app from Processing, the ChucK VM binary will be executed from inside the app. So as a user of said app you don't need to worry about ChucK being in your path at all.

Right now i'm generating and executing a bash script file, but this way i don't get any console output from ChucK back into Processing:

#!/bin/bash
cd "[to where the Chuck executable is located]"
./chuck --kill
killall chuck # just to make sure
./chuck chuckScript1.ck cuckScriptn.ck

then

Process p = Runtime.getRuntime().exec("chmod 777 "+scriptPath);
p = Runtime.getRuntime().exec(scriptPath);

This works but i want to run ChucK directly from Processing instead, but can't get it to execute:

String chuckPath = "[folder in which the chuck executable is located]"
ProcessBuilder builder = new ProcessBuilder
 (chuckPath+"/chuck", "test.ck");
 final Process process = builder.start();
 InputStream is = process.getInputStream();
 InputStreamReader isr = new InputStreamReader(is);
 BufferedReader br = new BufferedReader(isr);
 String line;
 while((line = br.readLine()) != null) println(line);
 println("done chuckin'! exitValue: " + process.exitValue());

Sorry if this is newbie style :D

asked May 21, 2010 at 10:29

1 Answer 1

1
ProcessBuilder builder = new ProcessBuilder
 (chuckPath+"/chuck", chuckPath+"/test.ck");

the args all need an absolute path.

answered May 21, 2010 at 10:42
Sign up to request clarification or add additional context in comments.

2 Comments

Please edit your question and do NOT provide more infos in an answer.
i've put this in an answer because this works. Since the arg to chuck is a file itself, it needed the full path as well.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.