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


Groups > comp.lang.python > #29533

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

From Christian Heimes <christian@python.org>
Subject Re: How to get the list of all my open file(descriptor)s and locks?
Date 2012-09-20 02:39 +0200
References <CANXECd56v1aefBgEeFv6=96w9ooM-HyjbpvE+d2SaZpRXhX7Mg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.946.1348101909.27098.python-list@python.org> (permalink)

Show all headers | View raw


Am 19.09.2012 19:34, schrieb Ismael Farfán:
> Hello list
> 
> From man 2 EXECVE
> "By default, file descriptors remain open across an execve()"
> 
> And from man 2 FCNTL
> "Record locks are... preserved across an execve(2)."
> 
> 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?

Have a look at psutil:

http://code.google.com/p/psutil/#Process_management

Christian

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


Thread

Re: How to get the list of all my open file(descriptor)s and locks? Christian Heimes <christian@python.org> - 2012-09-20 02:39 +0200

csiph-web