#1704: redirect stdout and stderr of all processes if requested (also of the root process) --------------------------+------------------------------------------------- Reporter: knarf | Owner: Type: enhancement | Status: reopened Priority: optional | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+-------------------------------------------------
Comment (by rhaas):
If Cactus indeed only uses freopen to redirect stdout and stderr, then there may already be an issue with redirecting output from Fortran's WRITE statement which has not reason to use the C stdout and stderr streams I think (maybe new Fortran versions say newer than 2003 may do that. Would you know, Peter?).
In the case that Fortran code is not required to use stdout and stderr (but instead uses file ids 1 and 2) we can instead use the dup2 call in unistd.h (and fileno to get the file id of the redirection file from fopen).