Subject: [clisp-list] Q: problem with run-program in Win32

From: [email-masked]
Date: Tue Feb 19 20:07:02 2002

CLISP-list

I'm trying to use the run-program command to simply run the "dir" command to
list the directory, but I must be doing something wrong:

5. Break [6]> (run-program "dir")

[%s:10790]
*** - Win32 error 2 (ERROR_FILE_NOT_FOUND): The system cannot find the file
specified.

Outside of the CLISP environment, the "dir" command runs just fine.

Any  suggestions?  This machine is running Windows2000.

Thanks for your help,

Tara
*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
Tara C. Matise, Ph.D.              [email-masked]
Department of Genetics          732-445-3125 (P)
Rutgers University                 732-445-1147 (F)

Nelson Biological Laboratories - B211
604 Allison Road
Piscataway, NJ 08854-8082

---

From: Sam Steingold <[email-masked]>
Date: Tue Feb 19 22:09:02 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Q: problem with run-program in Win32"
> * Sent on Tue, 19 Feb 2002 23:05:33 -0500
> * Honorable [email-masked] writes:
>

"dir" is a shell built-in.
try
(shell "dir")
or
(run-program "dir" :indirect t)
or
(run-program "cmd /c dir")

(untested, but I hope other win32 users will comment)

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
Never trust a man who can count to 1024 on his fingers.

---

From: Arseny Slobodjuck <[email-masked]>
Date: Tue Feb 19 23:06:05 2002

Hello, Sam,

>> *** - Win32 error 2 (ERROR_FILE_NOT_FOUND): The system cannot find the file

Sam> "dir" is a shell built-in.
Sam> try
Sam> (shell "dir")
doesn't work in NT
Sam> or
Sam> (run-program "dir" :indirect t)
indirectp - works, but undocumented
Sam> or
Sam> (run-program "cmd /c dir")
doesn't work

-- 
Best regards,
 Arseny                            mailto:[email-masked]

---

From: Sam Steingold <[email-masked]>
Date: Wed Feb 20 11:30:41 2002

Hi Arseny
(thanks for the thread patch - it's in)

> * In message <[email-masked]>
> * On the subject of "Re[2]: [clisp-list] Q: problem with run-program in Win32"
> * Sent on Wed, 20 Feb 2002 17:03:40 +1000
> * Honorable Arseny Slobodjuck <[email-masked]> writes:
>

this is an FAQ, but we do not have an FAQ list.
any volunteers?

> Sam> "dir" is a shell built-in.
what's the error message?
SHELL should work on NT.
what about (shell "/c dir")?

> indirectp - works, but undocumented
it will be in a couple of minutes...

> Sam> (run-program "cmd /c dir")

yes, of course!  it should have been
(run-shell-command "cmd /c dir") or
(run-program "cmd" :arguments '("/c" "dir"))

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
Good judgment comes from experience and experience comes from bad judgment.