Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: How to get the list of all my open file(descriptor)s and locks? (http://www.velocityreviews.com/forums/t952433-re-how-to-get-the-list-of-all-my-open-file-descriptor-s-and-locks.html)

Ismael Farfán 09-19-2012 08:36 PM

Re: How to get the list of all my open file(descriptor)s and locks?
 
2012/9/19 Ismael Farfán <sulfurfff@gmail.com>:
> 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?
>
>
> 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.
>
> From a standalone test within the interpreter I'd expect to get (at
> least) std(in/out/err).
>
> If more information is needed in order to help me, please let me know.
>
> Cheers
> Ismael
>
>
> --
> Do not let me induce you to satisfy my curiosity, from an expectation,
> that I shall gratify yours. What I may judge proper to conceal, does
> not concern myself alone.


It seems like I can use os.fstat to find out if a fd exists and also
get it's type and mode (I'm getting some pipes too : )

I hope it's portable across platforms, if someone knows a better
solution please let me know.

Ismael



--
Do not let me induce you to satisfy my curiosity, from an expectation,
that I shall gratify yours. What I may judge proper to conceal, does
not concern myself alone.


All times are GMT. The time now is 07:42 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57