Page 1 of 1

How to detect stdin?

Posted: Sat Aug 12, 2006 7:04 am
by Shannara
I have found a way to send data to a console program via SendProgramString() command. However, in the console program, how do I read that string without locking the console program?

I have found the input() command, but it locks the console program.

There is also the InKey() however, it does not seem to be able to read any input from the "pipe".

Re: How to detect stdin?

Posted: Sat Aug 12, 2006 7:31 am
by Michael Vogel
Shannara wrote:I have found a way to send data to a console program via SendProgramString() command. However, in the console program, how do I read that string without locking the console program?
Sorry, where you've found the SendProgramString() - I can't see it in PB4 - maybe you've a library?

For piped data I use ReadConsoleData - but it seems for me that you want to transfer data when the console program is already running? Here it would be fine to know what SendProgramString() does...

Posted: Sat Aug 12, 2006 9:31 am
by walker
Isn't the Process-lib (4.0) applicable for you?
There you have WriteProgramString() etc. for the communication between programs...

Posted: Sat Aug 12, 2006 9:51 pm
by Shannara
Purebasic 4 has the Process library built in :) This is where all the commands are coming from. It's even in the help file :) But the process library is missing the ability to read data from a program that is using SendProgramString() command.

My question is, does anybody know how to read such data?