Looking for "stdin", "stdout" 
Author Message
 Looking for "stdin", "stdout"

I have been trying to find the method / access to the "C " language equivalant
of "stdin" and "stdout". I need this because of "tool interoperability".
Several of the tools can access and provide data to other tools directly by
writing to and reading from stdout and stdin. The user just supplies these as
the units and the tool takes it from there without the user worrying what unit
is tied to where. ( as in - read(thisVar, stdin) ).

Any thoughts in this direction that you might have would be appreciated. I have
looked at the method printOn: and it is less than obvious to me how to specify
whatever unit constitutes the "stdout" target, or how to access the stuff
comming in via the "stdin" port. I am using VisualWorks 2.0 from ParcPlace as
well as their earlier Smalltalk product.

Thanks,

Mike G.



Fri, 09 Oct 1998 03:00:00 GMT  
 Looking for "stdin", "stdout"
I have been trying to find the method / access to the "C " language equivalant
of "stdin" and "stdout". I need this because of "tool interoperability".
Several of the tools can access and provide data to other tools directly by
writing to and reading from stdout and stdin. The user just supplies these as
the units and the tool takes it from there without the user worrying what unit
is tied to where. ( as in - read(thisVar, stdin) ).

Any thoughts in this direction that you might have would be appreciated. I have
looked at the method printOn: and it is less than obvious to me how to specify
whatever unit constitutes the "stdout" target, or how to access the stuff
comming in via the "stdin" port. I am using VisualWorks 2.0 from ParcPlace as
well as their earlier Smalltalk product.

Thanks,

Mike G.



Fri, 09 Oct 1998 03:00:00 GMT  
 Looking for "stdin", "stdout"

Quote:

> I have been trying to find the method / access to the "C " language equivalant
> of "stdin" and "stdout". I need this because of "tool interoperability".
> Several of the tools can access and provide data to other tools directly by
> writing to and reading from stdout and stdin. The user just supplies these as
> the units and the tool takes it from there without the user worrying what unit
> is tied to where. ( as in - read(thisVar, stdin) ).

> Any thoughts in this direction that you might have would be appreciated. I have
> looked at the method printOn: and it is less than obvious to me how to specify
> whatever unit constitutes the "stdout" target, or how to access the stuff
> comming in via the "stdin" port. I am using VisualWorks 2.0 from ParcPlace as
> well as their earlier Smalltalk product.

> Thanks,

> Mike G.

I don't have VW handy, but I have done this before in a previous
project. Take a look at the IOAccessor and its various Unix
subclasses. Create a new IOAccessor with the descriptor 0,1 or 2.

Alex
especially the



Sat, 10 Oct 1998 03:00:00 GMT  
 Looking for "stdin", "stdout"

Quote:

>I have been trying to find the method / access to the "C " language
>equivalant of "stdin" and "stdout".

Attached something about 'VW 2.0 stdout equivalent' from my private archive

Hope it helps - Toni

-----
Anton Zimmermann, Systemprogrammer
Swiss Federal Office of Information Technology and Systems

Voice : +41/31/325-9724; Fax:    +41/31/325-9767
Mail  : Steigerhubelstr. 3, CH-3003 Berne, Switzerland

============================ Start of attachment ============================

Subject: Re: VW 2.0 stdout equivalent?
Date: Thu, 11 May 1995 09:54:23 -0400
Organization: Bytesmiths, a technical services company


Quote:


...
> >I would like to stream some output back to UNIX...
> Have a look at the UnixProcess class in VW 2.0.  It can fork a UNIX
> process, and I think do what you need.

No, it's even easier than that. You don't need a separate process. UNIX
standard output is on file descriptor 1, so you can simply write to an
appropriate Stream:

   stdoutStream := ExternalWriteStream on:
      (ExternalConnection
         inputAccessor: (IOAccessor new handle: 1)
         outputAccessor: (IOAccessor new handle: 1)).
   stdoutStream lineEndLF

Now whenever you want to pipe back to UNIX, simply do "stdoutStream

nextPutAll: 'stuff for UNIX'."

For productization, we do the same thing for standard error (using file
descriptor 2), and then #become: it with the Transcript. Now all those
pesky "Transcript show:" things people accidentally left in their code
gets dumped to stderr. (You do need to add a little TextCollector protocol
to ExternalWriteStream for this to work reliably.)


 2002 Parkside Court, West Linn, OR 97068-2767 USA, +1 503 657 7703
 1025 Grenon #1002, Ottawa, Ontario K2B 8S5 Canada, +1 613 820 9919

============================ End of attachment ============================



Sun, 11 Oct 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

2. BEGIN{want[]={"s1o", "s2o", "s2q", "s3q"}

3. Parsing ""D""?

4. "Fifth", "Forth", zai nar?

5. Ruby "finalize", "__del__"

6. beginners "let"/"random" question

7. ANNOUNCE: new "plus"- and "dash"-patches available for Tcl7.5a2/Tk4.1a2

8. getline VAR <"-" (from stdin) INOP

9. STDIN and CALL "SYSTEM" questions

10. Tcl Question on testing "stdin"

11. Hi, this code: text0 = "One $BLAH Three" text1 = "One @BLAH Three" text0.sub!("$BLAH", "Two") text1.sub!("@BLAH", "Two") print text0,"\n" print text1,"\n" produces thiHi, this code: text0 = "One $BLAH Three" text1 = "One @BLAH Three" text0.sub!("$BLAH", "T

12. Match "ab" in "abc", but not in "abd"

 

 
Powered by phpBB® Forum Software