|
Re: troubleshooting question: msg#00170lang.smalltalk.squeak.beginners
On Thu, Jul 20, 2006 at 11:03:11AM -0700, Thomas Keller wrote: > Perhaps this is the problem? > When I ran this in a worksheet: > a _ OSProcess thisOSProcess stdOut. > Transcript show: a > > show: returned "nil" > So nextPutAll: has no where to print to? Yes, that's exactly right. Your system cannot find its standard output (because it does not have the necessary platform-specific OSProcess plugin installed), so its standard output is nil. And nil is really an object, like everything else in Squeak. When you send the message #nextPutAll: to the nil object, the nil object responds by throwing a MessageNotUnderstood error (MessageNotUnderstood is also an object, you can find in in a browser if you like). The default response to a MessageNotUnderstood error is to open a debugger, which lets you poke around and figure out what went wrong. > So my next question is how do I find the systems STDOUT pid? There are several ways to answer this, so let me start by taking the question literally. With the VM and plugins you are currently using, you cannot see either the pid of the process that Squeak is running in, or the identity of the STDOUT steam. But not to worry, you probably don't really need either of these. It may seem odd at first, but try to think of Squeak as a self contained object environment, rather than as a program that does I/O to STDOUT and to files. The Transcript usually plays the role of STDOUT in the sense that you can evaluate things and show the result on the Transcript. Even more commonly, you can evaluate an expression (which may invoke some computation of arbitrary complexity), and "inspect it" to see the results directly. But back to being literal. If you really want to see the pid of the current Squeak process, and to have access to the STDOUT, STDIN, and STDERR streams, then you need to run your Squeak image with a virtual machine that has the OSProcess plugin extension. You can get this from http://www.squeakvm.org/unix/. If you install the MacOSX VM from this page, it will provide the OSProcess plugin, and if you run your Squeak image with this VM, it should do exactly what you want. I'm glad that you are interested in OSProcess, because I wrote it. But what I really hope is that you will quickly discover that OSProcess is completely unnecessary for almost everything you will want to do in Squeak. In my own experience, the more I became comfortable with Squeak, the less I worried about traditional file I/O and the like. It's nice to be able to do that stuff (hence the OSProcess extensions), but it's rarely needed once you get comfortable with the Squeak environment. Dave
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: inserting images with Seaside, David Shaffer |
|---|---|
| Next by Date: | Can't work out the linux install, tom |
| Previous by Thread: | Re: troubleshooting question, Bert Freudenberg |
| Next by Thread: | Re: troubleshooting question, Thomas Keller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |