Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with SBCL RUN-PROGRAM

109 views
Skip to first unread message

Mark Tarver

unread,
Sep 5, 2016, 12:16:11 PM9/5/16
to
I have a weird problem with SBCL RUN-PROGRAM. I want to invoke the browser from SBCL.

I define this function

(DEFUN browse (URL) (RUN-PROGRAM *browser* (LIST URL) :WAIT NIL))

I set *browser* to the default location for IE.

(SETQ *browser* "C:\Program Files\Internet Explorer\iexplore.exe")

If I type (browse "http://shenlanguage.org/") I get the Shen homepage. I kill IE - it is fine.

But if I create an event loop and call this command in response to a user event (clicking a button) nothing happens. I have to actually type something to the REPL and hit RETURN and *then* IE pops up. When IE pops up, I get an error message.

couldn't read from #<SB-SYS:FD-STREAM for "standard input" {24CAA1F1}>:
Input/output error

Any ideas?

Mark

Alberto Riva

unread,
Sep 5, 2016, 1:54:05 PM9/5/16
to
Feels like the problem is in your event loop, more than in RUN-PROGRAM.
Could you show us how that's implemented? You could also try tracing
RUN-PROGRAM, to see if it gets called before or after you hit return.
That should tell you something...

Alberto


Mark Tarver

unread,
Sep 6, 2016, 3:48:00 AM9/6/16
to
I've done it in a completely different way and it works, thx. No idea why RUN-PROGRAM should behave like that and my hunch was that the reason would be very hard to find.

Mark

Faré

unread,
Sep 28, 2016, 9:51:47 PM9/28/16
to
The default :input nil and :output nil ought to prevent any interaction with the console. But SBCL's run-program is notoriously lacking on Windows. You may need to patch it.

Otherwise, I recommend that you use UIOP:RUN-PROGRAM instead, since it is more portable and can paper over *some* of the limitations of each platform. I haven't used Windows in years, so cannot vouch that it will solve your problem, though.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
You can discover what your enemy fears most by observing the means he uses
to frighten you. — Eric Hoffer

0 new messages