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

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
Last-modified: 2015-03-08 (日) 00:00:00