Jump to content

v3.1.1


Jon
 Share

Recommended Posts

So I would recommend the names StdErrPeek(), StdOutPeek().  It is possible if you read the character and then use the C function to put a character back onto an input stream.  This function usually only allows the last character read to be returned to the input stream.  Nuts, I wish I remembered the name of the function.  Where is My K&R C manual?  :D

The peek functionality is present in the current implementation, using the higher-level Win32 API PeekNamedPipe() function, which I had been using for other stuff anyway.

I had thought to minimize the sprawl of functions by delivering different behavior with special argument values and flag parameters to the 3 STDIO function calls:

;Close Stdin
StdinWrite($process)                    ; Called with no data to write...

;Peek 10 characters from Stdout, Stderr
$foo = StdoutRead($process, 10, 1)    ; Called with peek
$foo = StdoutRead($process, 10, 1)    ; param set to TRUE

;Get number of waiting chars on Stdout, Stderr
$foo = StdoutRead($process, 0, 1)      ; Called with readsize
$foo = StdoutRead($process, 0, 1)      ; param set to 0

...but it may be that it would be better to have StdinClose(), StdxxxPeek() and StdxxxCharsWaiting() or whatever. There'd be little more code & redundancy that the functions defs themselves, and if it spares a thread on the forum :) then I'm OK with that.

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...