org.mbari.siam.utils
Class SystemCall

java.lang.Object
  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
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

SystemCall

public SystemCall()
Method Detail

call

public static int call(java.lang.String callString)
Call the system() C run-time call

Parameters:
callString - String to pass to the system() call

isLoaded

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


main

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

Parameters:
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"
Throws:
java.io.IOException


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.