|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.luaj.vm2.lib.OsLib
org.luaj.vm2.lib.jse.JseOsLib
public class JseOsLib
Subclass of LibFunction which implements the standard lua os library.
This contains more complete implementations of the following functions using features that are specific to JSE:
execute()remove()rename()tmpname()
Because the nature of the os library is to encapsulate
os-specific features, the behavior of these functions varies considerably
from their counterparts in the C platform.
Typically, this library is included as part of a call to
JsePlatform.standardGlobals()
Globals globals = JsePlatform.standardGlobals();
System.out.println( globals.get("os").get("time").call() );
For special cases where the smallest possible footprint is desired,
a minimal set of libraries could be loaded
directly via Globals#load(LuaValue) using code such as:
Globals globals = new Globals();
globals.load(new JseBaseLib());
globals.load(new PackageLib());
globals.load(new JseOsLib());
System.out.println( globals.get("os").get("time").call() );
However, other libraries such as MathLib are not loaded in this case.
LibFunction,
OsLib,
JsePlatform,
org.luaj.vm2.lib.jme.JmePlatform,
Lua 5.2 OS Lib Reference| Field Summary | |
|---|---|
static int |
EXEC_ERROR
return code indicating the execute() threw an unknown exception |
static int |
EXEC_INTERRUPTED
return code indicating the execute() was interrupted |
static int |
EXEC_IOEXCEPTION
return code indicating the execute() threw an I/O exception |
| Constructor Summary | |
|---|---|
JseOsLib()
public constructor |
|
| Method Summary | |
|---|---|
protected Varargs |
execute(java.lang.String command)
|
protected void |
remove(java.lang.String filename)
|
protected void |
rename(java.lang.String oldname,
java.lang.String newname)
|
protected java.lang.String |
tmpname()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int EXEC_IOEXCEPTION
public static int EXEC_INTERRUPTED
public static int EXEC_ERROR
| Constructor Detail |
|---|
public JseOsLib()
| Method Detail |
|---|
protected Varargs execute(java.lang.String command)
protected void remove(java.lang.String filename)
throws java.io.IOException
java.io.IOException
protected void rename(java.lang.String oldname,
java.lang.String newname)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String tmpname()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||