[squeak-dev] Windows, stdin, stdout

Benoit St-Jean bstjean at yahoo.com
Sat Apr 7 00:38:41 UTC 2018


Thanks for your help.
So far, I've had :

a) lots of "primitive failed", most of the time primitiveFileAtEnd (FilePlugin)
b) An error/warning message in the console, "VirtualProtect(x,y,PAGE_EXECUTE_READWRITE): No error" and then nothing happens, not even a prompt!c) A "Manufactured file handle detected" errord) An emergency error handlere) An error saying "stdout is not open"f) the VM terminating abruptlyg) The "Squeak Cog Spur Virtual Machine" unresponsive and totally frozen (not even able to interrupt it!)
I tried the original and some refactored (VERY simple snippets) examples I could find on the net using :

a) OSProcessb) FileStreamc) StdioListener
I have tried all tips & tricks : 
a) load the "application code" from a scriptb) doIt the code in a workspace and save the imagec) doIt some code with code to save the image first so the rest of the doIt resumes at startupd) I tried so many things I don't remember it all!!

So far, nothing worked, not even was I once close !  Except for the example with StdioListener : it shows the prompt but does nothing with the input...

I'm using Squeak 5.1 32bit on Windows 10.
My goal is to produce a headless application is a *simple* way.  It can be a script or some code I execute in a workspace.  Then save the image (or whatever step is required).  
When running the application, I don't want to have to specify a script to start it up from the console.  Also, I don't want to open another command window!  I want the app/image to run from the command window without any artifact/trick the same way any other Windows utility/app would work.  I also want the application to be interactive (it waits for input, does something with the input, then shows result and presents me with a prompt again).
Once I get this to work, you can be sure I'll document it in detail !!!!



----------------- 
Benoît St-Jean 
Yahoo! Messenger: bstjean 
Twitter: @BenLeChialeux 
Pinterest: benoitstjean 
Instagram: Chef_Benito
IRC: lamneth 
Blogue: endormitoire.wordpress.com 
"A standpoint is an intellectual horizon of radius zero".  (A. Einstein) 

    On Friday, April 6, 2018, 5:42:27 p.m. EDT, tim Rowledge <tim at rowledge.org> wrote:  
 
 

> On 06-04-2018, at 11:10 AM, Alistair Grant <akgrant0710 at gmail.com> wrote:
> 
> Hi Benoit,
> 
> On 6 April 2018 at 12:16, Benoit St-Jean via Squeak-dev
> <squeak-dev at lists.squeakfoundation.org> wrote:
>> Is there any way I can start squeak from a command window, *headless*, and
>> WITHOUT providing a script and have an interactive application^  Say, for
>> instance, my application waits for input and answers back the square of the
>> number I type in?
>> 
>> I've tried a gazillion examples I found and it just doesn't work at all...
>> 
>> I'm on Windows 10 if that helps.
> 
> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/image/buildspurtrunkreaderimage.sh

Just for the record here for the future - this process 
a) simply loads the CogTools-Listener (sub)package from the VMMaker repository - which is a very small bit of code we could very sensibly include in the default image
b) uses a simple initial script to create an image that will start up at the beginning of an incantation that loops around the StdioListener. All you do is start up the image saved after loading the Listener tools with the StartReader.st - subsequent runs do not need that.

Unfortunately it doesn't seem to be working quite right on my Pi at the moment; I get a "squeak>" prompt but it doesn't seem to ever read any input. I know it works in principle because I've used it plenty of times in the past , but clearly I'm forgetting some important detail.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful Latin Phrases:- Te audire no possum. Musa sapientum fixa est in aure. = I can't hear you. I have a banana in my ear.



  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180407/b06ffb0a/attachment.html>


More information about the Squeak-dev mailing list