problem in file name with space
-
hi in linux .
i want pass a file name in qprosess .
but file name with space is not exquting the command in qprosess.like this file path .file name has a space "new h"
engrampa \"file:///home/shaber/Desktop/new h\" -d
terminal add a "" in every space .how can i achieve that.
i tried qurl .but % is not accepted by terminal. -
hi in linux .
i want pass a file name in qprosess .
but file name with space is not exquting the command in qprosess.like this file path .file name has a space "new h"
engrampa \"file:///home/shaber/Desktop/new h\" -d
terminal add a "" in every space .how can i achieve that.
i tried qurl .but % is not accepted by terminal.@saber said in problem in file name with space:
engrampa "file:///home/shaber/Desktop/new h" -d
Does using single quotes work?
engrampa '/home/shaber/Desktop/new h' -d
-
QProcess will handle this for you. Just pass the arguments to QProcess correctly with setArguments and the rest is done for you.
-
QProcess will handle this for you. Just pass the arguments to QProcess correctly with setArguments and the rest is done for you.
@Christian-Ehrlicher said in problem in file name with space:
Just pass the arguments to QProcess correctly with setArguments and the rest is done for you.
Hi, to be fair, I have never used
QProcess
myself, but for @saber, could you show how to apply it for his/her specific example above? -
Hi,
Something like:
QProcess process; QStringList arguments{"file:///home/saver/Desktop/new h/", "-d"}; process.start("engrampa", arguments);