forking + stdout = confusion

Carsten Schabacker cs at spock.rhein-neckar.de
Tue Apr 13 06:02:51 EDT 1999


clarence at silcom.com (Clarence Gardner) writes:

> I thought that maybe sys.stdout was using a dup()'ed copy of stdout,
> but I checked sys.stdout.fileno() and it was 1, so that doesn't seem
> to be the case.
No, the child and the parent share the SAME filedescriptors.  This is true
for ALL open files!  So if you don't need the descriptors in a child or a
parent you should close them.  

Apache waits for the end of the file, so all processes (parents and
childs) must close the file!

greetings from germany
Carsten




More information about the Python-list mailing list