Can not handle space in cmd passed in Runtime.getRuntime().exec() on LINUX
Hi,
I am trying to excute an exe fromjava program onLINUX. This exe takes a file as argument so that the exe can write some text in the file. But if a space comes in the path of file the problem occurs.
I clear it with my real case.
I am trying to execute these line
String cmdLine="\"/root/My Progs/out.exe \" +\"/root/out/out.txt"
Runtime.getRuntime().exec(cmdLine);
But it is not consideringMy Prog as a single directory instead looking for/root/My folder.
It says /root/My : not found
If i change the folderMy Prog toMyProg every thing goes fine.
what should i do to over come this problem ? Can any one help me?
thanks and regards,
rahul

