开发者

Lua and the white spaces of the OS. How to solve?

开发者 https://www.devze.com 2023-02-23 22:22 出处:网络
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 comman

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")
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号