Luaで良く作る関数 ~io編~

os_shell_execute

-- os.execute はプログラムとしてのリターン値が返ってくるが、
-- os.shell_execute は対象プログラムの出力文字が返ってくる。
function os.shell_execute(str_command)
    local handle = io.popen(str_command)
    local result = handle:read("*a")
    handle:close()
end

トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS