Class SystemCall

  extended by org.mbari.siam.utils.SystemCall

public class SystemCall
extends java.lang.Object

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
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)
Call the system() C run-time call

callString - String to pass to the system() call


public static boolean isLoaded()
Return true if System.loadLibrary() call succeeded, false if not.


public static void main(java.lang.String[] args)
Main routine, for unit testing only

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"

Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.