projects
/
kmrcl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ce1dec8
)
r10677: fix func name
author
Kevin M. Rosenberg
<kevin@rosenberg.net>
Fri, 26 Aug 2005 20:02:05 +0000
(20:02 +0000)
committer
Kevin M. Rosenberg
<kevin@rosenberg.net>
Fri, 26 Aug 2005 20:02:05 +0000
(20:02 +0000)
os.lisp
patch
|
blob
|
history
diff --git
a/os.lisp
b/os.lisp
index 805b10c3c5275baa529601ad4350c2e37a55c38c..5db6be7895700eee4ae2c86f8dfc92bb709ee73e 100644
(file)
--- a/
os.lisp
+++ b/
os.lisp
@@
-15,11
+15,11
@@
(defun command-output (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
(defun command-output (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
-synchronously execute the result using a Bourne-compatible shell,
+synchronously execute the result using a Bourne-compatible shell,
returns (VALUES string-output error-output exit-status)"
(let ((command (apply #'format nil control-string args)))
#+sbcl
returns (VALUES string-output error-output exit-status)"
(let ((command (apply #'format nil control-string args)))
#+sbcl
- (let* ((process (sb-ext:run-program
+ (let* ((process (sb-ext:run-program
"/bin/sh"
(list "-c" command)
:input nil :output :stream :error :stream))
"/bin/sh"
(list "-c" command)
:input nil :output :stream :error :stream))
@@
-30,11
+30,11
@@
returns (VALUES string-output error-output exit-status)"
(values
output
error
(values
output
error
- (sb-impl::process-exit-code process)))
+ (sb-impl::process-exit-code process)))
+
-
#+(or cmu scl)
#+(or cmu scl)
- (let* ((process (ext:run-program
+ (let* ((process (ext:run-program
"/bin/sh"
(list "-c" command)
:input nil :output :stream :error :stream))
"/bin/sh"
(list "-c" command)
:input nil :output :stream :error :stream))
@@
-52,12
+52,12
@@
returns (VALUES string-output error-output exit-status)"
(multiple-value-bind (output error status)
(excl.osi:command-output command :whole t)
(values output error status))
(multiple-value-bind (output error status)
(excl.osi:command-output command :whole t)
(values output error status))
-
+
#+lispworks
;; BUG: Lispworks combines output and error streams
(let ((output (make-string-output-stream)))
(unwind-protect
#+lispworks
;; BUG: Lispworks combines output and error streams
(let ((output (make-string-output-stream)))
(unwind-protect
- (let ((status
+ (let ((status
(system:call-system-showing-output
command
:prefix ""
(system:call-system-showing-output
command
:prefix ""
@@
-65,16
+65,16
@@
returns (VALUES string-output error-output exit-status)"
:output-stream output)))
(values (get-output-stream-string output) nil status))
(close output)))
:output-stream output)))
(values (get-output-stream-string output) nil status))
(close output)))
-
- #+clisp
+
+ #+clisp
;; BUG: CLisp doesn't allow output to user-specified stream
(values
nil
nil
(ext:run-shell-command command :output :terminal :wait t))
;; BUG: CLisp doesn't allow output to user-specified stream
(values
nil
nil
(ext:run-shell-command command :output :terminal :wait t))
-
+
#+openmcl
#+openmcl
- (let* ((process (ccl:run-program
+ (let* ((process (ccl:run-program
"/bin/sh"
(list "-c" command)
:input nil :output :stream :error :stream
"/bin/sh"
(list "-c" command)
:input nil :output :stream :error :stream
@@
-86,7
+86,7
@@
returns (VALUES string-output error-output exit-status)"
(values output
error
(nth-value 1 (ccl::external-process-status process))))
(values output
error
(nth-value 1 (ccl::external-process-status process))))
-
+
#-(or openmcl clisp lispworks allegro scl cmu sbcl)
(error "COMMAND-OUTPUT not implemented for this Lisp")
#-(or openmcl clisp lispworks allegro scl cmu sbcl)
(error "COMMAND-OUTPUT not implemented for this Lisp")
@@
-94,24
+94,24
@@
returns (VALUES string-output error-output exit-status)"
(defun run-shell-command (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
(defun run-shell-command (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
-synchronously execute the result using a Bourne-compatible shell,
+synchronously execute the result using a Bourne-compatible shell,
returns (VALUES output-string pid)"
(let ((command (apply #'format nil control-string args)))
#+sbcl
(sb-impl::process-exit-code
returns (VALUES output-string pid)"
(let ((command (apply #'format nil control-string args)))
#+sbcl
(sb-impl::process-exit-code
- (sb-ext:run-program
+ (sb-ext:run-program
"/bin/sh"
(list "-c" command)
:input nil :output nil))
"/bin/sh"
(list "-c" command)
:input nil :output nil))
-
+
#+(or cmu scl)
(ext:process-exit-code
#+(or cmu scl)
(ext:process-exit-code
- (ext:run-program
+ (ext:run-program
"/bin/sh"
(list "-c" command)
:input nil :output nil))
"/bin/sh"
(list "-c" command)
:input nil :output nil))
-
-
+
+
#+allegro
(excl:run-shell-command command :input nil :output nil
:wait t)
#+allegro
(excl:run-shell-command command :input nil :output nil
:wait t)
@@
-123,17
+123,17
@@
returns (VALUES output-string pid)"
:show-cmd nil
:prefix ""
:output-stream nil)
:show-cmd nil
:prefix ""
:output-stream nil)
-
+
#+clisp ;XXX not exactly *verbose-out*, I know
(ext:run-shell-command command :output :terminal :wait t)
#+clisp ;XXX not exactly *verbose-out*, I know
(ext:run-shell-command command :output :terminal :wait t)
-
+
#+openmcl
(nth-value 1
(ccl:external-process-status
(ccl:run-program "/bin/sh" (list "-c" command)
:input nil :output nil
:wait t)))
#+openmcl
(nth-value 1
(ccl:external-process-status
(ccl:run-program "/bin/sh" (list "-c" command)
:input nil :output nil
:wait t)))
-
+
#-(or openmcl clisp lispworks allegro scl cmu sbcl)
(error "RUN-SHELL-PROGRAM not implemented for this Lisp")
#-(or openmcl clisp lispworks allegro scl cmu sbcl)
(error "RUN-SHELL-PROGRAM not implemented for this Lisp")
@@
-168,9
+168,9
@@
returns (VALUES output-string pid)"
#+sbcl (sb-posix:getpid)
#+cmu (unix:unix-getpid)
#+openmcl (ccl::getpid)
#+sbcl (sb-posix:getpid)
#+cmu (unix:unix-getpid)
#+openmcl (ccl::getpid)
- #+(and clisp unix) (system::pro
gram
-id)
+ #+(and clisp unix) (system::pro
cess
-id)
#+(and clisp win32) (cond ((find-package :win32)
#+(and clisp win32) (cond ((find-package :win32)
- (funcall (find-symbol "GetCurrentProcessId"
+ (funcall (find-symbol "GetCurrentProcessId"
:win32)))
(t
(system::getenv "PID")))
:win32)))
(t
(system::getenv "PID")))