Difference between revisions of "Os.run"

From ComputerCraft Wiki
Jump to: navigation, search
m (Moved to CAT:LuaCoreFunctions)
m (Table -> {{type|table}}, String -> {{type|string}})
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=os.run
 
|name=os.run
|args=[[metatable]] envVars, [[string]] path, [[vararg]] arguments
+
|args={{Type|table}} envVars, {{Type|string}} path, ...
|api=os
+
|api=OS
 
|returns=false on error, otherwise true
 
|returns=false on error, otherwise true
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 +
|desc=Executes a file from the filesystem. The Lua program contained in <var>path</var> is invoked. At its file-level scope, the program sees the usual global symbols plus everything in the <var>envVars</var> table. Any additional parameters passed after <var>path</var> are visible as <code>...</code> from the called program.
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Runs the default shell
+
|desc=Runs the default shell.
 
|code=os.run({}, "rom/programs/shell")
 
|code=os.run({}, "rom/programs/shell")
 
|output=The default shell
 
|output=The default shell

Latest revision as of 00:36, 6 May 2013


Grid Redstone.png  Function os.run
Executes a file from the filesystem. The Lua program contained in path is invoked. At its file-level scope, the program sees the usual global symbols plus everything in the envVars table. Any additional parameters passed after path are visible as ... from the called program.
Syntax os.run(table envVars, string path, ...)
Returns false on error, otherwise true
Part of ComputerCraft
API OS

Examples

Grid paper.png  Example
Runs the default shell.
Code
os.run({}, "rom/programs/shell")
Output The default shell