Changeset 13361


Ignore:
Timestamp:
06/22/11 13:39:47 (10 years ago)
Author:
Mark Evenson
Message:

Edit RUN-PROGRAM documentation lightly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/run-program.lisp

    r13271 r13361  
    3434(require "JAVA")
    3535
    36 ;;Vaguely inspired by sb-ext:run-program in SBCL. See <http://www.sbcl.org/manual/Running-external-programs.html>. This implementation uses the JVM facilities for running external processes: <http://download.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html>.
     36;;; Vaguely inspired by sb-ext:run-program in SBCL.
     37;;;
     38;;; See <http://www.sbcl.org/manual/Running-external-programs.html>.
     39;;;
     40;;; This implementation uses the JVM facilities for running external
     41;;; processes.
     42;;; <http://download.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html>.
    3743(defun run-program (program args &key environment (wait t))
    3844  ;;For documentation, see below.
     
    4955
    5056(setf (documentation 'run-program 'function)
    51       "run-program creates a new process specified by the program argument. args are the standard arguments that can be passed to a program. For no arguments, use nil (which means that just the name of the program is passed as arg 0).
     57      "Creates a new process running the the PROGRAM.
     58ARGS are a list of strings to be passed to the program as arguments.
    5259
    53 run-program will return a process structure.
     60For no arguments, use nil which means that just the name of the
     61program is passed as arg 0.
     62
     63Returns a process structure containing the JAVA-OBJECT wrapped Process
     64object, and the PROCESS-INPUT, PROCESS-OUTPUT, and PROCESS-ERROR streams.
     65
     66c.f. http://download.oracle.com/javase/6/docs/api/java/lang/Process.html
    5467
    5568Notes about Unix environments (as in the :environment):
    5669
    57     * The ABCL implementation of run-program, like SBCL, Perl and many other programs, copies the Unix environment by default.
    58     * Running Unix programs from a setuid process, or in any other situation where the Unix environment is under the control of someone else, is a mother lode of security problems. If you are contemplating doing this, read about it first. (The Perl community has a lot of good documentation about this and other security issues in script-like programs.)
     70    * The ABCL implementation of run-program, like SBCL, Perl and many
     71      other programs, copies the Unix environment by default.
     72
     73    * Running Unix programs from a setuid process, or in any other
     74      situation where the Unix environment is under the control of
     75      someone else, is a mother lode of security problems. If you are
     76      contemplating doing this, read about it first. (The Perl
     77      community has a lot of good documentation about this and other
     78      security issues in script-like programs.)
    5979
    6080The &key arguments have the following meanings:
    6181
    62 :environment
    63     a alist of STRINGs (name . value) describing the new environment. The default is to copy the environment of the current process.
    64 :wait
    65     If non-NIL (default), wait until the created process finishes. If nil, continue running Lisp until the program finishes.")
     82:environment
     83    An alist of STRINGs (name . value) describing the new
     84    environment. The default is to copy the environment of the current
     85    process.
     86
     87:wait
     88    If non-NIL, which is the default, wait until the created process
     89    finishes. If NIL, continue running Lisp until the program
     90    finishes.")
    6691
    6792;;The process structure.
     
    93118  (%process-kill (process-jprocess process)))
    94119
    95 ;;Low-level functions. For now they're just a refactoring of the initial implementation with direct
    96 ;;jnew & jcall forms in the code. As per Ville's suggestion, these should really be implemented as
    97 ;;primitives.
    98 
     120;;; Low-level functions. For now they're just a refactoring of the
     121;;; initial implementation with direct jnew & jcall forms in the
     122;;; code. As per Ville's suggestion, these should really be implemented
     123;;; as primitives.
    99124(defun %make-process-builder (program args)
    100125  (java:jnew "java.lang.ProcessBuilder"
Note: See TracChangeset for help on using the changeset viewer.