You are not logged in.
I'm currently authoring a python binding for a third-party application. A function of the third-party applications allows users to set the filename to "-" which will then print the result to stdout. I'd like to be able to catch that output into a buffer and handle it entirely in memory rather than creating a temporary file on disk (that's why freopen does not fit for this). Can someone give me a hint?
Offline
It's not possible to do such a thing in standard C (that is, without POSIX extensions). Instead, try looking at popen(3).
Offline
POSIX is fine. It may be great to have a platform-independent way for doing this, but I found my solution with glibc's open_memstream().
Offline