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


Groups > comp.lang.python > #90861

Re: fork/exec & close file descriptors

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'explicitly': 0.05; 'subject:file': 0.07; 'skip:/ 10': 0.09; 'cc:addr:python-list': 0.11; 'descriptors': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'linux).': 0.16; 'magic': 0.16; 'symlink': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'appears': 0.22; 'cc:addr:python.org': 0.22; 'entries': 0.24; 'skip': 0.24; 'cc:2**0': 0.24; 'possibly': 0.26; 'subject:/': 0.26; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'usually': 0.31; 'file': 0.32; 'open': 0.33; 'linux': 0.33; 'point.': 0.35; 'received:google.com': 0.35; 'use.': 0.39; '20,': 0.68; 'subject: & ': 0.68; '2015': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=uEOHikzGhTiLGUo2/mfohJRyAfSBdUoQnDdNAPUYpyA=; b=J2dHC28PoDkszfQOxPpb18pAKV5eEOiKCvVnDuzLBh0JFsEPH/kSxDjVmMDPcylatS uallGaI03Ddq1U2SvT2ucZSLZWK2qdVumyWxavBHhIZwUeiWOc5SIYfEYWl623ZuZhqA 3Q8YnpnMu9gEkAhEGuoX2/o9tVoGhszHdlP0eQxrUxTTHAW8U7YkfqYzyU8JxsUkL2il AaPglwxQDFi7YhSTpWthfRVB00H9Q0r0ouIRsuOdl/UimLTnVHQCiEKfgip0/I5ZmVif A7yWf2SbQdibGUd5ZbBcdemyY2xAelDinvUyT0gAIibNbpmdwdRUQrFS3iM6a4ptlTuN zaqQ==
MIME-Version 1.0
X-Received by 10.50.141.164 with SMTP id rp4mr22269839igb.2.1432048429749; Tue, 19 May 2015 08:13:49 -0700 (PDT)
In-Reply-To <CANc-5UwWcJm_S7QMtP2gC1aW5U=iQRvrxVb=dPWjzE78-rL_9w@mail.gmail.com>
References <CANc-5UyeaWqThGFSAuGskz+S2Lrgq0ia9W9DHAie28t9GY+sww@mail.gmail.com> <CAPTjJmoj4STV9+t2-9JWed3t6Hxk5ibtaxYSFfX31oGz=kKR1g@mail.gmail.com> <CANc-5UwUxYjg=rQQ0Z_nM3s7o4+ghVYzG-9ajQY=LERWAsPrKw@mail.gmail.com> <CAPTjJmrdPcW8EkLR9Kq+n9sYEWB8eJ3fg=_JFQ2x_4QhDeg90Q@mail.gmail.com> <CANc-5UwWcJm_S7QMtP2gC1aW5U=iQRvrxVb=dPWjzE78-rL_9w@mail.gmail.com>
Date Wed, 20 May 2015 01:13:49 +1000
Subject Re: fork/exec & close file descriptors
From Chris Angelico <rosuav@gmail.com>
Cc Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.140.1432048432.17265.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432048432 news.xs4all.nl 2856 [2001:888:2000:d::a6]:40673
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:90861

Show key headers only | View raw


On Wed, May 20, 2015 at 12:31 AM, Skip Montanaro
<skip.montanaro@gmail.com> wrote:
> On Tue, May 19, 2015 at 8:54 AM, Chris Angelico <rosuav@gmail.com> wrote:
>>
>> On Linux (and possibly some other Unixes), /proc/self/fd may be of
>> use.
>
>
> Good point. Yes, /proc/PID/fd appears to contain all the entries for open
> file descriptors (I am on Linux).

Yes, and /proc/self is usually a magic symlink to /proc/<your_pid> so
you can just look at /proc/self/fd instead of explicitly calling up
your own PID.

ChrisA

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


Thread

Re: fork/exec & close file descriptors Chris Angelico <rosuav@gmail.com> - 2015-05-20 01:13 +1000

csiph-web