Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - C question | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
labmaster Blue Octorok Level: 12 Posts: 16/43 EXP: 6135 For next: 1786 Since: 07-17-04 From: New Zealand! Since last post: 10 days Last activity: 2 min. |
| ||
Okay, here's the scenario. I have a program called A.exe. I want A.exe to be able to run B.exe (a command line program), and capture its output, storing it into a buffer. Is this possible with C/++, and if so, would I do it (I know it can be done with some scripting languages like perl). Note: Names have been changed to protect their identity. |
|||
Euclid Cheep-cheep Level: 23 Posts: 129/193 EXP: 65528 For next: 2195 Since: 03-15-04 From: Australia Since last post: 24 days Last activity: 7 days |
| ||
I remember being able to do that in unix... though i have no idea if the c function call "System(" what I'll be doing is something like this: System("b.exe > somefile"); then all the input you want is in somefile. But if you want A.exe and B.exe to run together and depending on what happens in B, A will act differently, then you'll have to go into all those yucky semaphores and monitors. (and shared memory and stuff) |
|||
labmaster Blue Octorok Level: 12 Posts: 17/43 EXP: 6135 For next: 1786 Since: 07-17-04 From: New Zealand! Since last post: 10 days Last activity: 2 min. |
| ||
Yeah, that's what I've got at the moment (slightly less pretty, it creates a temporary batch file and winexec's it), I was hoping there was a better way of doing it, but I can live with that. | |||
Parasyte Bullet Bill Level: 35 Posts: 194/514 EXP: 267348 For next: 12588 Since: 05-25-04 Since last post: 104 days Last activity: 32 days |
| ||
This is probably what you want: http://www.codeproject.com/threads/redir.asp | |||
labmaster Blue Octorok Level: 12 Posts: 18/43 EXP: 6135 For next: 1786 Since: 07-17-04 From: New Zealand! Since last post: 10 days Last activity: 2 min. |
| ||
Awesome - thanks Para. |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - C question | | | |