Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!oboe.cis.ohio-state.edu!timothy_hansell From: timothy_hansell@oboe.cis.ohio-state.edu Newsgroups: comp.lang.smalltalk Subject: Re: Anyway to run a program directly from smalltalk? Message-ID: <77422@tut.cis.ohio-state.edu> Date: 21 Feb 90 15:52:14 GMT References: <19566@mephisto.UUCP> Sender: usenet_news@tut.cis.ohio-state.edu Reply-To: Timothy Hansell Distribution: na Organization: Ohio State University Computer and Information Science Lines: 51 In article <19566@mephisto.UUCP> hsu@boa.gatech.edu (Yung-Kao Hsu) writes: >I've been working on implementing an environment which requires >an interaction between smalltalk and prolog (on Sun workstation). >The communication between the two is thru the use of socket which >comes with ParcPlace System with a C program acts as an agent. >However, the establishing of the comunication link between the >process and Socket are extremely slow and very often freezes >the system for about 3 minutes just for it. Furthermore, one have >to always remember to run the agent beforehand. > >The problem could be greatly reduced if somehow I could build >an object that could run a "prolog" or any other process directly >by sending a message to it. Has anyone here known of such thing? If you look at the Terminal object you will see that it is invoking the c-shell and then passing through commands from the user to the shell. It is possible to use this same connection that is used by the Terminal to send command strings directly to the shell. I've seen it done on some utilities that ParcPlace is working on. This would allow you to start up your 'agent' from inside smalltalk ( by that I mean have an object actually send the command not the user ). The problem with this approach is that the documentation about how this works at that level is very slim ( at least in release 2.3. I haven't seen the docs for 2.5 yet so I don't know what it says ) Another possibilty, if ParcPlace has added the feature in 2.5 would be to access the unix 'system' call that runs a command. Many of the unix calls were available in 2.3 but this particular one was either missing or not documented. But this feature allows you to make unix system calls directly from smalltalk. Yet one more way to solve the problem, would be to create a user-primitive that allows you to send unix commands, and then build an object to be an interface to this user-primitive. There is a great deal of documentation on user-primitves, and since you write them in 'C' you can do anything you do in C with them. Sorry, I can't offer any direct help. I've been separated from Smalltalk for over 6 months now ( believe me it's not easy switching back to C ) and I don't have direct access to either a running Smalltalk or to the documentation. > >---- >YUNG-KAO HSU at ICS, Georgia Tech | FREE |~~|~~~~~~~~~~~~~~~~~~~|> >bears the responsiblity for this ads. | RESUME |* | I need Food. |> >Question? Contact=> hsu@boa.gatech | TAKE |* | will work!! |> >This is a Limited Time Offer. Hurry!! | ONE |*_|___________________|> -tim --- Tim Hansell hansell@cis.ohio-state.edu P.O. Box 687 South Charleston, Ohio, 45268