OSProcess runs out of resources? (and other errors)
Stefan Matthias Aust
sma at 3plus4.de
Wed May 24 17:18:54 UTC 2000
With the help of David Pennell, I was able to test the OSProcess package
for Squeak on Solaris 7. It's working fine, however, I can call an
external program only for about 10 times. Thereafter, I get strange errors.
I'd guess the system runs out of some resources, file handles or so. This
is very bad as I need to call it much more often. I'd like to free the
resources but I didn't find a method to clean up (or close) a
ConnectedProcess (this is what I use right now). Does anybody notice this
and/or has a workaround?
Then I noticed that stdOut atEnd doesn't work. I never returns true, even
if stdOut next (correctly) answers nil. This is bad as a couple of stream
methods don'T work, for example #upToEnd. I wrote a workaround by
implementing that method in terms of next not using atEnd but still, that's
probably a bug that must be fixed elsewhere.
It's also annoying that there's no automatic cr/lf conversion: I simply
implemented
next
| n |
^(n _ super next) == Character lf
ifTrue: [Character cr]
ifFalse: [n]
but I think, this still a general smalltalk problem. I also changed
cr
self nextPut: Character lf
so that I can use the normal Smalltalk style of dealing with
streams. However, I know this is only a hardcoded solution for Unix. When
somebody implements the OSProcess system for other platforms, we need a
more clever solution here.
But: Thank you for providing the code. It's nevertheless very useful.
bye
--
Stefan Matthias Aust // Bevor wir fallen, fallen wir lieber auf
More information about the Squeak-dev
mailing list
|