When using the Shell command I can redirect STDOUT with the standard command line syntax. I have used the technique to use write files then open them in my code.
However Is there a way to have the program output to a pipe and have my program read from the pipe without using an intermediate file ?
I just joined up here and I saw your post. I just had the exact same need. Thought of redirects and pipes, but I resolved the problem using a tcp connection between the two programs. I despaired of the built in tcp functions and unsafe warnings in qbpe docs, and just rolled my own little client / server in C to do the job. The qbpe / C code interface is really powerful once you figure out how to pass data from/to it. This was only made difficult because I don't actually know what I'm doing. I will put together a simple example for you and post it out here later if you are interested.
(09-29-2024, 01:58 PM)Gomez Addams Wrote: I just joined up here and I saw your post. I just had the exact same need. Thought of redirects and pipes, but I resolved the problem using a tcp connection between the two programs. I despaired of the built in tcp functions and unsafe warnings in qbpe docs, and just rolled my own little client / server in C to do the job. The qbpe / C code interface is really powerful once you figure out how to pass data from/to it. This was only made difficult because I don't actually know what I'm doing. I will put together a simple example for you and post it out here later if you are interested.
First, Welcome the the forum!
Yes, I would very much like to see this. Thank you for sharing.
New to QB64pe? Visit the QB64 tutorial to get started. QB64 Tutorial
I attempted an upload of the code... see if this is of any use.
Please recompile for your env as I am running Debian SID which means my
compilations may contain updated libraries others dont have yet.
10-01-2024, 11:45 AM (This post was last modified: 10-01-2024, 11:46 AM by SpriggsySpriggs.)
You can do STDOUT like you were asking for with pipecom. In Linux/Mac, stdout can be captured without a file. On Windows, stdout and stderr can both be captured without a file.
Pipecom is a utility I wrote for myself because I was sick of using files to capture shell commands. Files are the worst way to grab commands.