[Python-Dev] closing files and sockets in a timely manner in the stdlib

Bobby Impollonia bobbyi at gmail.com
Sun Oct 31 00:12:13 CEST 2010

On Sat, Oct 30, 2010 at 12:06 PM, Glyph Lefkowitz
<glyph at twistedmatrix.com> wrote:
> That path (and anything below /proc, really) is a list of open file
> descriptors specifically on Linux, not "*nix".  Also on linux, you can avoid
> "<your pid here>" by just doing "/proc/self".
> A more portable (albeit not standard) path for "what file descriptors do I
> have open" is /dev/fd/.  This is supported via a symlink to /proc/self on
> all the Linuxes I've tested on.  There's no portable standard equivalent for
> not-yourself processes that I'm aware of, though.
> See more discussion here: <http://twistedmatrix.com/trac/ticket/4522>.

lsof(8) is available for Linux, FreeBSD, Mac any many other *nixes:

More information about the Python-Dev mailing list