Hi Both,<br><br><div class="gmail_quote">2010/10/3 Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Sun, 3 Oct 2010, Chris Muller wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for the code Eliot.  Can you give me a hint about proper usage.<br>
In the current trunk I tried<br>
<br>
 CrLfFileStream newForStdio<br></blockquote></div></blockquote><div><br></div><div>Levente, as usual, is exactly right.  use e.g. StandardFileStream stdout.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
but I was not able to nextPutAll: a String onto that (rwmode was not set).<br>
<br>
I also found StandardFileStream<br>
class&gt;&gt;#standardIOStreamNamed:forWrite: but it has undeclared<br>
variable, &quot;stdioFiles&quot;.  Is that supposed to be a class-inst var<br>
defined at the StandardFileStream level?  Senders did not help me<br>
understand what arguments I should pass...<br>
</blockquote>
<br></div>
That class instance variable is missing, but the code still works. Try this:<br>
<br>
CrLfFileStream stdout nextPutAll: &#39;Hello World!&#39;.<br></blockquote><div><br></div><div>That&#39;s right.  This is missing:</div><div><br></div><div><div>StandardFileStream class</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>instanceVariableNames: &#39;stdioFiles&#39;</div>
</div><div><br></div><div>best</div><div>Eliot</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888">
<br>
<br>
Levente</font><div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Sorry for my confusion..<br>
<br>
- Chris<br>
<br>
<br>
On Mon, Sep 27, 2010 at 1:09 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Sun, Sep 26, 2010 at 10:18 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;<br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi Levente,<br>
<br>
On Sun, Sep 26, 2010 at 7:13 PM, Levente Uzonyi &lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Sun, 26 Sep 2010, Eliot Miranda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Chris,<br>
<br>
  I have code for this, but right now I need to crack some crabs, so I<br>
don&#39;t have time to verify this code in 4.1 :)  Use at your own risk ;)<br>
 The<br>
most important thing is the StandardFileStream&gt;&gt;stdioHandles primitive<br>
for<br>
accessing the streams.  N.B. some work needs to be done on the win32<br>
FilePlugin support code before this will work on Windows.<br>
</blockquote>
<br>
All three streams seem to be working on Windows Vista with the latest<br>
CogVM.<br>
This seems to be a really cool feature, though I think CrLfFileStream<br>
should be deprecated, so MultiByteFileStream support would be better IMO.<br>
</blockquote>
<br>
The streams work if directed to files.  But they will /not/ work if<br>
directed to input or output in a console window.  I should have been<br>
clearer, sorry.  The work needed is in<br>
platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c where if input and/or<br>
output is the console we need to use ReadConsole &amp; WriteConsole in place of<br>
ReadFile &amp; WriteFile.<br>
</blockquote>
<br>
Hmmm.  Turns out I was confused about this.  One doesn&#39;t need ReadConsole &amp;<br>
WriteConsole; ReadFile &amp; WriteFile should do just fine.  But the Cog code<br>
doesnt work in either an MS-DOS console window or a cygwin console window.<br>
 If anyone&#39;s familiar with this area of Windows please feel free to take a<br>
look...<br>
TIA<br>
Eliot<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
cheers<br>
Eliot<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Levente<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Sun, Sep 26, 2010 at 2:46 PM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;<br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am developing a simple &quot;CommandLineProcessor&quot; facade for easily<br>
transferring command-line arguments simply as block-arguments, so you<br>
can write smalltalk scripts in vi:<br>
<br>
 CommandLineProcessor do: [ : arg1 : arg2 : arg3 | &quot;args come in as<br>
Strings&quot; ... ]<br>
<br>
and also for directing Notifications and Warnings messages to stdOut,<br>
and Errors to stdErr.  It relies on OSProcess to write to stdOut and<br>
stdErr for this.  However, ever since switching to Cog, writing to<br>
these streams does not seem to redirect out to Linux..<br>
<br>
I don&#39;t know whether writing to these streams makes me<br>
Linux-dependent, but it really is nice to be able to write Linux<br>
scripts that employ Squeak in the back-end, but operate normally like<br>
other shell programs in the terminal window and with redirecting<br>
output, etc.<br>
<br>
 - Chris<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
</div></div><br><br>
<br></blockquote></div><br>