|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.utils.SystemCall
public class SystemCall
SystemCall is a simple JNI interface to the C runtime "system()" call.
The problem with Runtime.exec() is that the created Process does not have its own terminal or console. All standard I/O is read/written to the streams created with the Process, which by default have no readers or writers. This causes problems in running shell scripts or running in background mode
| Constructor Summary | |
|---|---|
SystemCall()
|
|
| Method Summary | |
|---|---|
static int |
call(java.lang.String callString)
Call the system() C run-time call |
static boolean |
isLoaded()
Return true if System.loadLibrary() call succeeded, false if not. |
static void |
main(java.lang.String[] args)
Main routine, for unit testing only |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SystemCall()
| Method Detail |
|---|
public static int call(java.lang.String callString)
callString - String to pass to the system() callpublic static boolean isLoaded()
public static void main(java.lang.String[] args)
throws java.io.IOException
args - - args[0] is passed to system()
To test a call that itself has arguments, enclose the
entire string in quotes; e.g.
java moos.utils.SystemCall "echo this is a test"
java.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||