[armedbear-cvs] r14235 - trunk/abcl/src/org/armedbear/lisp
mevenson at common-lisp.net
mevenson at common-lisp.net
Fri Nov 9 14:44:28 UTC 2012
Author: mevenson
Date: Fri Nov 9 06:43:24 2012
New Revision: 14235
Log:
RUN-PROGRAM: refactor symbols and improve docstring.
Modified:
trunk/abcl/src/org/armedbear/lisp/run-program.lisp
Modified: trunk/abcl/src/org/armedbear/lisp/run-program.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/run-program.lisp Fri Nov 9 06:43:09 2012 (r14234)
+++ trunk/abcl/src/org/armedbear/lisp/run-program.lisp Fri Nov 9 06:43:24 2012 (r14235)
@@ -44,18 +44,24 @@
;;; This implementation uses the JVM facilities for running external
;;; processes.
;;; <http://download.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html>.
-(defun run-program (program args &key environment (wait t) clear-env)
+(defun run-program (program args &key environment (wait t) clear-environment)
+ "Run PROGRAM with ARGS in with ENVIRONMENT variables.
+Possibly WAIT for subprocess to exit.
+
+Optionally CLEAR-ENVIRONMENT of the subprocess of any non specified values."
;;For documentation, see below.
- (let ((pb (%make-process-builder program args)))
- (let ((env-map (%process-builder-environment pb)))
- (when clear-env
+ (let* ((program-namestring (namestring (pathname program)))
+
+ (process-builder (%make-process-builder program-namestring args)))
+ (let ((env-map (%process-builder-environment process-builder)))
+ (when clear-environment
(%process-builder-env-clear env-map))
(when environment
(dolist (entry environment)
(%process-builder-env-put env-map
(princ-to-string (car entry))
(princ-to-string (cdr entry))))))
- (let ((process (make-process (%process-builder-start pb))))
+ (let ((process (make-process (%process-builder-start process-builder))))
(when wait (process-wait process))
process)))
@@ -171,4 +177,4 @@
(ignore-errors (java:jcall "exitValue" jprocess)))
(defun %process-kill (jprocess)
- (java:jcall "destroy" jprocess))
\ No newline at end of file
+ (java:jcall "destroy" jprocess))
More information about the armedbear-cvs
mailing list