I'm having a hard time opening a file on Mac OS X.
The following code works only if the filepath/filename doesn't contain a space:
String filepath;
Runtime rt = Runtime.getRuntime();
rt.exec( "open " + filepath);
From a terminal, I can surround the filepath with either apostrophes or quotes and OS X will open the file no problem, even if it has spaces.
If I call:
filepath = "\"" + filepath + "\"";
rt.exec( "open " + filepath);
...then nothing happens. No error, no popup, no exception thrown...nothing. Same thing if I use apostrophes vice quotes.
Any ideas? I'm using JDK 5.0 as 6.0 is not yet supported by Apple.
Thanks in advance.