Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #90847

fork/exec & close file descriptors

Date 2015-05-19 07:59 -0500
Subject fork/exec & close file descriptors
From Skip Montanaro <skip.montanaro@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.131.1432040344.17265.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Due to presumed bugs in an underlying library over which I have no control,
I'm considering a restart in the wee hours of the morning. The basic
fork/exec dance is not a problem, but how do I discover all the open file
descriptors in the new child process to make sure they get closed? Do I
simply start at fd 3 and call os.close() on everything up to some largish
fd number? Some of these file descriptors will have been opened by stuff
well below the Python level, so I don't know them a priori.

Thx,

Skip

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

fork/exec & close file descriptors Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-19 07:59 -0500

csiph-web