[Wisp-cvs] wisp/users/pisi dialect.pisi.wim,1.6,1.7
Status: Alpha
Brought to you by:
digg
From: <pi...@us...> - 2003-02-09 15:56:19
|
Update of /cvsroot/wisp/wisp/users/pisi In directory sc8-pr-cvs1:/tmp/cvs-serv26919 Modified Files: dialect.pisi.wim Log Message: fork-error replaced with stating Index: dialect.pisi.wim =================================================================== RCS file: /cvsroot/wisp/wisp/users/pisi/dialect.pisi.wim,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dialect.pisi.wim 9 Feb 2003 11:59:14 -0000 1.6 +++ dialect.pisi.wim 9 Feb 2003 15:56:10 -0000 1.7 @@ -19,20 +19,25 @@ (hide loop ,@body) (loop))) -;;; (unix-command "command with options" (pathref)) -(define (unix-command commando (*pathlist* (cond - ((env-ref "PATH") (split-by-char #\: (env-ref "PATH"))) - (else '())))) +;;; (executable? /filename/) + +;;; (unix-command "command with options" (pathref)) +(define (unix-command commando + (pathlist (cond + ((env-ref "PATH") => + (cut split-by-char #\: <>)) + (else '())))) (if (not (any (lambda (otsikoht) (try - (begin - (my cmdlist (string->word-list commando) - (call-process `(,(string-append otsikoht "/" (first cmdlist)) ,@(cdr cmdlist)))) - #t) + (my cmdlist (string->word-list commando) + (my pathplace "$,[otsikoht]/$,(first cmdlist)" + (case (file-type pathplace) + ((regular) (call-process `(,pathplace ,@(cdr cmdlist))) #t) + (else #f)))) (except () #f))) - *pathlist*)) - (raise 'no-command-in-path commando)) + pathlist)) + (raise 'no-good-command-in-path commando)) ) |