Changeset 15397
- Timestamp:
- May 29, 2012, 2:07:06 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/source/level-1/linux-files.lisp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/level-1/linux-files.lisp
r15232 r15397 1717 1717 "Invoke an external program as an OS subprocess of lisp." 1718 1718 (declare (ignore pty)) 1719 (unless (every #'(lambda (a) (typep a 'simple-string)) args) 1719 (push program args) 1720 (unless (do* ((args args (cdr args))) 1721 ((atom args) 1722 (or (typep args 'simple-string) 1723 (null args))) 1724 (unless (typep (car args) 'simple-string) 1725 (return))) 1720 1726 (error "Program args must all be simple strings : ~s" args)) 1721 (push program args)1722 1727 (let* ((token (list 0)) 1723 1728 (in-fd nil) … … 1808 1813 (monitor-external-process proc)))) 1809 1814 1810 (defun join-strings (strings) 1811 (reduce (lambda (left right) (concatenate 'string left " " right)) strings)) 1815 (defun make-windows-command-line (strings) 1816 (with-output-to-string (out) 1817 (do* ((strings strings (cdr strings))) 1818 ((atom strings) 1819 (if strings (write-string strings out))) 1820 (let* ((string (car strings))) 1821 (dotimes (i (length string)) 1822 (let* ((c (schar string i))) 1823 (case c 1824 ((#\space #\tab) 1825 (write-char #\" out) 1826 (write-char c out) 1827 (write-char #\" out)) 1828 (#\" 1829 (write-char #\\ out) 1830 (write-char #\" out)) 1831 (t (write-char c out))))) 1832 (when strings (write-char #\space out)))))) 1812 1833 1813 1834 (defun create-windows-process (new-in new-out new-err cmdstring env) … … 1849 1870 (defun exec-with-io-redirection (new-in new-out new-err args proc &optional env) 1850 1871 (multiple-value-bind (win handle-to-process-or-error) 1851 (create-windows-process new-in new-out new-err ( join-stringsargs) env)1872 (create-windows-process new-in new-out new-err (make-windows-command-line args) env) 1852 1873 (if win 1853 1874 handle-to-process-or-error
Note:
See TracChangeset
for help on using the changeset viewer.
