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


Groups > comp.lang.python > #95855

Re: Low level file descriptors and high-level Python files

Path csiph.com!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <lac@openend.se>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'filename': 0.07; 'properly.': 0.07; 'subject:file': 0.07; 'cc:addr:python-list': 0.09; 'creighton': 0.09; 'descriptor': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'subject:files': 0.09; '>on': 0.16; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'did.': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message-id:@fido.openend.se': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'wrote:': 0.16; 'later': 0.16; 'laura': 0.18; '2015': 0.20; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; 'meant': 0.22; 'saying': 0.22; 'affects': 0.22; 'sep': 0.22; 'file.': 0.22; 'tired': 0.27; 'received:se': 0.29; 'cc:no real name:2**1': 0.29; 'somebody': 0.30; 'open': 0.33; 'tue,': 0.34; 'file': 0.34; 'running': 0.34; 'could': 0.35; 'replaced': 0.35; "isn't": 0.35; 'but': 0.36; 'closing': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'say': 0.37; 'charset:us- ascii': 0.37; 'things': 0.38; 'thank': 0.38; 'files': 0.38; 'subject:-': 0.39; 'still': 0.40; 'some': 0.40; 'header:Message- Id:1': 0.61; 'you.': 0.64; 'between': 0.65; 'header:In-reply- to:1': 0.84; 'open,': 0.84; 'edwards': 0.91
To Grant Edwards <invalid@invalid.invalid>
cc python-list@python.org, lac@openend.se
From Laura Creighton <lac@openend.se>
Subject Re: Low level file descriptors and high-level Python files
In-reply-to <ms5893$aqj$1@reader1.panix.com>
References <55e5bcd3$0$1639$c3e8da3$5496439d@news.astraweb.com> <mailman.53.1441129318.23514.python-list@python.org> <ms5893$aqj$1@reader1.panix.com>
Comments In-reply-to Grant Edwards <invalid@invalid.invalid> message dated "Tue, 01 Sep 2015 22:19:15 -0000."
MIME-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-ID <24930.1441177344.1@fido>
Content-Transfer-Encoding quoted-printable
Date Wed, 02 Sep 2015 09:02:24 +0200
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Wed, 02 Sep 2015 09:02:27 +0200 (CEST)
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.6.1441177351.8327.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1441177351 news.xs4all.nl 23753 [2001:888:2000:d::a6]:41990
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:95855

Show key headers only | View raw


In a message of Tue, 01 Sep 2015 22:19:15 -0000, Grant Edwards writes:
>On 2015-09-01, Laura Creighton <lac@openend.se> wrote:
>
>> Don't go around closing things you don't know are open.  They
>> could be some other processes' thing.
>
>I don't understand.  Closing a file descriptor that isn't open is
>harmless, isn't it?  Closing one that _is_ open only affects the
>current process.  If other processes had the same fd open, it's still
>open for them.
>
>-- 
>Grant Edwards               grant.b.edwards        Yow! FUN is never having to
>                                  at               say you're SUSHI!!
>                              gmail.com            

This is me being tired and not saying things properly.  What I meant was
don't go around closing mkstemp files thinking you can reopen them later,
because in between the time you use mkstemp to make the file and you open
it up again later somebody else may have replaced that file.  Including
some other program running mkstemp which was desparate to make the exact same
filename you did.  But that's not what I said ... so thank you.

Laura

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


Thread

Low level file descriptors and high-level Python files Steven D'Aprano <steve@pearwood.info> - 2015-09-02 00:57 +1000
  Re: Low level file descriptors and high-level Python files random832@fastmail.us - 2015-09-01 11:56 -0400
  Re: Low level file descriptors and high-level Python files Laura Creighton <lac@openend.se> - 2015-09-01 19:41 +0200
    Re: Low level file descriptors and high-level Python files Grant Edwards <invalid@invalid.invalid> - 2015-09-01 22:19 +0000
      Re: Low level file descriptors and high-level Python files Laura Creighton <lac@openend.se> - 2015-09-02 09:02 +0200

csiph-web