Hi
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 #if JUCE_MAC childAppFile = childAppFile.getSiblingFile("childApp.app/Contents/MacOS/childApp"); #elif JUCE_WINDOWS childApp = childAppFile.getSiblingFile("childApp.exe"); #endif 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?