lua 判斷平臺的另類辦法

方法

local file = io.popen("echo $(uname)")
local platform
if file then
	platform = file:read("*a"):gsub("\n", "")
	file:close()
else
	platform = "Windows"
end
print(platform)
相關文章
相關標籤/搜索