I have some console utility. I start process to execute this utility with some parameters. One parameter is filename.
If filename is not contains spaces, all worked. But with spaces I get error from utility: “no such file or directory”. If I set filename parameter, still do not work. But interested: if I call utility from command line (not from android/java), all worked. If I replace space on %20, anyway do not work:
1) filename (original): util dir\some test.txt – not worked (java, cmd). It’s normal.
2) filename (quates): util “dir\some test.txt” – work in cmd and do not work in java.
3) filename (encode): util “dir\some%20test.txt” – not worked (java, cmd).
PS: utility is ffmpeg
I know about special chars. I do not set filename manual. I have some file, use
getAbsoluteFile()and all backslashes ok.I execute process as:
Where cmd is my command: util filename.
UPD:
Now use ProcessBuilder with arguments String[]. Worked.