A
Arved Sandstrom
[ SNIP ]Am 23.04.2013 12:48, schrieb Steven Simpson:
I haven't checked your code, but I have written the inverse to
CommandLineToArgv in Java. It's not that hard. Passing the result to
ProcessBuilder works fine - even though that it works is based on the
two silly undocumented facts: (1) ProcessBuilder adds quotes if and only
if the argument doesn't start and end with quotes and (2) ProcessBuilder
doesn't mess with quotes and backslashes inside the arguments.
The problem with Java's ProcessBuilder is, that people use it "willy
nilly" being completely oblivous about the fact that it doesn't do what
might be best for them. (Recall the case "c:\\program files\\", "world"
where the two strings are basically merged to "c:\\program files\"
world". This is probably the scariest.)
Secondly, there is no way to pass the arguments correctly by only
relying on documented stuff.
That's the point a number of us have been making, Sven. In the case of
ProcessBuilder and Process you jump to no conclusions, and test your
specific case. Operative word being "test", as in unit test, functional
test, integration test, system test, UAT.
AHS