Lua and the white spaces of the OS. How to solve?
I'm trying to execute a command with io.popen
in Lua, but the path contains white spaces. I've tested 开发者_C百科with \\
, combinations of \"\'
, and so on. How to solve this, because the command always returns "C:\Program" not recognized....
See:Why won't applications in Program Files run using os.execute in lua?
the [[ ]] method works well for me.
You might want to try
io.popen([[C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/vcpackages/vcbuild.exe]], "r")
Note that you were calling the function with one argument that looked like this:
"C:/.../vcbuild.exe", "r"
local exe_path = '"C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/vcpackages/vcbuild.exe"'
io.popen(exe_path, "r")
精彩评论