-
November 16th, 2009, 10:37 AM
#1
Using pipes running apps
Hi,
I am trying to run a command line program (in windows), so I use the following code:
Code:
FILE *cmd_pipe;
cmd_pipe = popen ("WaveRecorder.exe temp.wav", "r");
pclose (cmd_pipe);
Now, I have a problem, my WaveRecorder stops when I press Enter key.
Is there a way to simulate "Enter" into the pipe? Is it possible to write more than one command into the pipe?
-
November 16th, 2009, 04:28 PM
#2
Re: Using pipes running apps
Command line programs which wait for the enter key are just waiting for the newline charicter "\n". You should be able to simply write that charicter to the pipe.
Code:
fputc('\n', cmd_pipe);
Notice the single quotes here not double quotes.
Hope this helps
Signature
Please use: [ code ][/ code ] tags and reasonably correct tabbing. They really help us read your code
End Signature
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|