Ignore:
Timestamp:
03/31/12 12:50:25 (9 years ago)
Author:
vvoutilainen
Message:

Add :clear-env to run-program, add getenv-all

File:
1 edited

Legend:

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

    r13361 r13899  
    4141;;; processes.
    4242;;; <http://download.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html>.
    43 (defun run-program (program args &key environment (wait t))
     43(defun run-program (program args &key environment (wait t) clear-env)
    4444  ;;For documentation, see below.
    4545  (let ((pb (%make-process-builder program args)))
    46     (when environment
    47       (let ((env-map (%process-builder-environment pb)))
     46    (let ((env-map (%process-builder-environment pb)))
     47      (when clear-env
     48        (%process-builder-env-clear env-map))           
     49      (when environment
    4850        (dolist (entry environment)
    4951          (%process-builder-env-put env-map
     
    8183
    8284: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.
     85    An alist of STRINGs (name . value) describing new
     86    environment values that replace existing ones.
     87
     88:clear-env
     89    If non-NIL, the current environment is cleared before the
     90    values supplied by :environment are inserted.
    8691
    8792:wait
     
    132137  (java:jcall "put" env-map key value))
    133138
     139(defun %process-builder-env-clear (env-map)
     140  (java:jcall "clear" env-map))
     141
    134142(defun %process-builder-start (pb)
    135143  (java:jcall "start" pb))
Note: See TracChangeset for help on using the changeset viewer.