Message118515
I don't think freopen() is the right solution, since it might open another (different) file descriptor under the hood; but Python always uses file descriptor 1 when creating sys.stderr.
I would suggest instead something such as (untested):
int tmpfd;
tmpfd = open("myfile.txt", O_CREAT | O_WRONLY);
dup2(tmpfd, 1); |
|
Date |
User |
Action |
Args |
2010-10-13 12:22:32 | pitrou | set | recipients:
+ pitrou, amaury.forgeotdarc, Mitchell.Stokes |
2010-10-13 12:22:32 | pitrou | set | messageid: <1286972552.6.0.379885435788.issue10080@psf.upfronthosting.co.za> |
2010-10-13 12:22:31 | pitrou | link | issue10080 messages |
2010-10-13 12:22:30 | pitrou | create | |
|