home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / lisp / 2224 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  2.3 KB

  1. Path: sparky!uunet!mcsun!uknet!ox-prg!gordon
  2. From: gordon@robots.oxford.ac.uk (Gordon Buxton)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Re: run-program in kcl
  5. Keywords: run-program, common lisp, kcl, load.
  6. Message-ID: <4280@inca.comlab.ox.ac.uk>
  7. Date: 14 Aug 92 09:49:39 GMT
  8. References: <1992Aug13.194657.6098@cs.albany.edu> <16fpq4INN848@early-bird.think.com>
  9. Sender: news@comlab.ox.ac.uk
  10. Organization: Robotics Research Group, Engineering Science Dept, Oxford, UK.
  11. Lines: 46
  12.  
  13. In article <16fpq4INN848@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
  14. >In article <1992Aug13.194657.6098@cs.albany.edu> saxena@cs.albany.edu (Tushar Saxena) writes:
  15. >>There is a function in common lisp called RUN-PROGRAM in Sun Common Lisp.
  16. >
  17. >This isn't a Common Lisp function, it's a Lucid extension.
  18. >
  19. >>First of all, has anyone ever heard of it? Secondly, what does this
  20. >>function do? 
  21. >
  22. >It runs a normal Unix program, as if you'd executed it from the shell.  It
  23. >can optionally connect the input and/or output streams of the program to
  24. >Lisp streams.  It's fully documented in the Working Beyond the Lisp
  25. >Environment section of the Advanced User's Guide chapter of the manual.
  26. >
  27. >>          And lastly, what is its counterpart in kcl. I know for sure
  28. >>that my version of kcl does not support it.
  29. >
  30. >There probably isn't a direct counterpart in KCL, since KCL doesn't provide
  31. >many extensions to CL.  The closest thing is probably calling the Unix
  32. >execlp(3) function.
  33. >
  34. >barmar@think.com          {uunet,harvard}!think!barmar
  35.  
  36.  
  37. There is a sort-of similar function in kcl called 'system'.  I don't
  38. think it is as good as the run-program in lucid, but it might be what
  39. you need ... eg:
  40.  
  41. >(system "ls")
  42. beef           factory        filesys.lsp    plan           user.o
  43. cd.o           features       filesys.o      user.lsp       work-elements
  44. 0
  45.  
  46. >(help 'system)
  47. -----------------------------------------------------------------------------
  48. SYSTEM                                                             [Function]
  49.  
  50. Args: (string)
  51. KCL specific: Executes a Shell command as if STRING is an input to the Shell.
  52. Not all versions of KCL support this function.
  53. -----------------------------------------------------------------------------
  54.  
  55. It works for me on akcl 1.605 for Unix and the current beta release
  56. akcl for dos.
  57.  
  58. Gordon.
  59.