How to detect stdin?

Just starting out? Need help? Post your questions and find answers here.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

How to detect stdin?

Post 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".
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: How to detect stdin?

Post 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...
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

Isn't the Process-lib (4.0) applicable for you?
There you have WriteProgramString() etc. for the communication between programs...
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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?
Post Reply