GSL Shell 学習:外部プログラムの実行
2016-03-01 : 
PCクリニック
Lua ドキュメントの日本語訳:「Lua 5.2 リファレンスマニュアル」には、
標準で組み込まれているモジュール 'os' (?) として、
os.clock
os.date
os.difftime
os.execute
os.exit
os.getenv
os.remove
os.rename
os.setlocale
os.time
os.tmpname
が載っている。
多分(当然?)
os.execute
が、“外部プログラムの実行”ですね。
やってみました。
その通り、でした。
でも、実行終了迄、待ちますね。
待たない方法は???
「Lua os.execute non-blocking」
で検索した結果、
見つけたのは:「lua-users wiki」の、
「Lua Reference Manual Comments」
This page contains comments and annotations on the content of
the Lua Reference Manual [1]
(version 5.1 unless otherwise stated).
Content can include comments, usage examples, and links that
clarify the manual content, including more advanced or
subtle points on specific functions in the API.
The order of content on this page should generally follow the
order of content in the manual.
See also the official Lua 5.1. Reference Manual Errata [2].
===例の翻訳サイトの結果:
このページには、コメントと Lua リファレンス マニュアル [1] のコンテンツ
に注釈が含まれています (バージョン 5.1 特記されない場合は)。
コンテンツは、コメント、使用例、および API の特定の機能により、
高度で微妙なポイントを含むマニュアルの内容を明らかにする
リンクを含めることができます。
このページのコンテンツの順序一般にマニュアルの
内容の順序に従ってください。
公式の Lua 5.1 を参照してください。参照マニュアル正誤表 [2]。
?????
このサイト、必携ですね。→ ブックマークした。
それで、
5.8 - Operating System Facilities
の
os.execute
の項目には、
See also the corresponding C system function [16]
In Windows, you can run a non-blocking process via os.execute
by prefixing the command with "start ".
On UNIX-like operating systems, you can postfix it with "&".
Both methods of course are non-portable. Example:
os.execute("start notepad") -- Windowsとあった。
os.execute("emacs &") -- UNIX
なるほど、
os.execute( 'notepad' )
と、
os.execute( 'start notepad' )
の違いですね。
本日はここまで。
更なる学習ダ。
Lua ( GSL Shell ) 学習は続く。
見ていただいた序でとは厚かましい限りですが、
お帰りに投票して頂けるとなお嬉しいです。 ⇒


151224
- 関連記事
-
- GSL Shell 学習:グローバル・テーブル arg (2016/03/06)
- GSL Shell 学習:ffi.cdef 二重定義は? (2016/03/05)
- GSL Shell 学習:OpenCV の CvMat 型 (2016/03/04)
- GSL Shell 学習:配列定義あれこれ (2016/03/02)
- GSL Shell 学習:外部プログラムの実行 (2016/03/01)
- GSL Shell 学習:LuaJIT の性能(例) (2016/02/28)
- GSL Shell 学習:モジュールの作り方 (2016/02/27)
- GSL Shell 学習:OpenCV の 'Callback' 処理 (2016/02/26)
- GSL Shell 学習:'bit'モジュール (2016/02/25)
スポンサーサイト