ChildProcess and spaces in path


I have a problem with ChildProcess and spaces in the file path.

I have a mainApp.exe and a childApp.exe. I want the mainApp to launch the childApp.

The two live in the same folder. I use ChildProcess in mainApp, and give it a path like this:


//Get the path of the mainApp

File childAppFile = File::getSpecialLocation(File::currentApplicationFile);

//Get the childApp binary


childAppFile = childAppFile.getSiblingFile("");


childApp = childAppFile.getSiblingFile("childApp.exe");


childProcess..start(childAppFile.getFullPathName() + “ “+Parameters, 1);


This works on windows, but on osx it fails if there are spaces in the path.

I hit the assertion:       

jassert ((! arguments[0].containsChar ('/'))

                  || File::getCurrentWorkingDirectory().getChildFile (arguments[0]).existsAsFile());


So if there is a space in the path the wrong file path is evaluated and existsAsFile returns false


If I add quotes (single or double) it does not work, either.

What am I doing wrong?


Try with this version and a quoted path

Thank you, overlooked that some how

The above link is dead. I’m having trouble with spaces in an executable name right now. Escaping them doesn’t seem to help. Is there a new location for the help file pointed to?

Here is the new link:

The above link is dead, but people keep on clicking on it, so it might be useful to have the new one: JUCE: ChildProcess Class Reference