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


Groups > comp.lang.python > #29528 > unrolled thread

Re: How to get the list of all my open file(descriptor)s and locks?

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-09-19 15:09 -0600
Last post2012-09-19 15:09 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to get the list of all my open file(descriptor)s and locks? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-19 15:09 -0600

#29528 — Re: How to get the list of all my open file(descriptor)s and locks?

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-09-19 15:09 -0600
SubjectRe: How to get the list of all my open file(descriptor)s and locks?
Message-ID<mailman.942.1348089019.27098.python-list@python.org>
On Wed, Sep 19, 2012 at 11:34 AM, Ismael Farfán <sulfurfff@gmail.com> wrote:
> So the question:
> * If I execve a python script (from C), how can I retrieve the list of
> files, and optionally the list of locks, from within the execve(d)
> python process so that I can use them?
>
>
> Some more info:
> I'm working with exotic stuff like AIX and Solaris 10 (Windows and
> linux too :) and my lowest common denominator is python 2.3.

You could do:

os.listdir("/proc/%d/fd" % os.getpid())

This should work on Linux, AIX, and Solaris, but obviously not on Windows.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web