Bug 524 : open() with space in path
Last modified: 2007-03-06 04:16




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P4
Severity:
normal

 

Reporter:
amiga2u
Assigned To:
fry

Attachment Type Created Size Actions
my solution for open() with path with spaces application/zip 2007-03-05 22:57 2.73 KB

Description:   Opened: 2007-02-26 22:50
When the path had space inside like open ("/Users/me/that app/one Big.app")
Processing read only /users/my/that"
If the path had no space like open("/Users/me/that_app/oneBig.app")
everithing is OK
Additional Comment #1 From fry 2007-02-27 04:30
that's a fact of life when dealing with the command line. usually you'd use
quotes to get around the situation, but more accurate is to use a String
array that contains each element of the command.

String[] s = { "/Users/blah/that app", "one Big.app" };
open(s);
Additional Comment #2 From amiga2u 2007-03-05 22:57
edit]
my solution for open() with path with spaces

Sorry, your suggestion:

String[] s = { "/Users/blah/that app", "one Big.app" };
open(s);

don't work on my Mac
Additional Comment #3 From fry 2007-03-06 04:16
since you're on osx, it's even more tricky. look at what happens when you
open a .app on the command line and the error that comes up:

: /Applications/Preview.app
-bash: /Applications/Preview.app: is a directory

the solution is to use the osx "open" command, and make that the first
parameter of that String array.

other questions, please use the forum as this is not a bug.