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

From Laura Creighton <lac@openend.se>
Subject Re: Low level file descriptors and high-level Python files
References <55e5bcd3$0$1639$c3e8da3$5496439d@news.astraweb.com> <mailman.53.1441129318.23514.python-list@python.org> <ms5893$aqj$1@reader1.panix.com>
Date 2015-09-02 09:02 +0200
Newsgroups comp.lang.python
Message-ID <mailman.6.1441177351.8327.python-list@python.org> (permalink)

Show all headers | 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