I have a string command I\'d like to execute asynchronously while writing to its input and reading its output. Sounds easy, right, the devil is in the cross-platform. I\'m t
Give libexecstream a whirl. It's cross platform, and allows you to trap the input, output and error streams of a process asynchronously as C++ style streams.
I've used it on Linux, Darwin and Windows and it seems to work. It's also pretty lightweight so integrates into projects with little pain, and has a pretty open BSD licence. I don't think there's any way around using a library (other than writing your own variations for each platform).
for converting windows HANDLE
s to C file descriptors use _open_osfhandle
http://msdn.microsoft.com/en-us/library/bdts1c9x%28VS.71%29.aspx
EDIT: this example once helped me aswell with a similar problem: http://www.halcyon.com/~ast/dload/guicon.htm