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


Groups > comp.lang.python > #102969

Re: Make a unique filesystem path, without creating the file

Path csiph.com!weretis.net!feeder6.news.weretis.net!feeder.erje.net!2.us.feeder.erje.net!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail
From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: Make a unique filesystem path, without creating the file
Date Mon, 15 Feb 2016 15:46:47 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 22
Message-ID <n9srt7$51v$1@reader1.panix.com> (permalink)
References <mailman.117.1455486378.22075.python-list@python.org>
NNTP-Posting-Host 67-130-15-94.dia.static.qwest.net
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace reader1.panix.com 1455551207 5183 67.130.15.94 (15 Feb 2016 15:46:47 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Mon, 15 Feb 2016 15:46:47 +0000 (UTC)
User-Agent slrn/1.0.2 (Linux)
Xref csiph.com comp.lang.python:102969

Show key headers only | View raw


On 2016-02-14, Ben Finney <ben+python@benfinney.id.au> wrote:
> Howdy all,
>
> How should a program generate a unique filesystem path and *not* create
> the filesystem entry?

Short answer: you can't because it's the filesystem entry operation
that is atomic and guarantees uniqueness.

> [..]

> What standard library function should I be using to generate
> ‘tempfile.mktemp’-like unique paths, and *not* ever create a real file
> by that path?

What's the point of creating a unique path if you don't want to create
the file?

-- 
Grant Edwards               grant.b.edwards        Yow! I'm rated PG-34!!
                                  at               
                              gmail.com            

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


Thread

Make a unique filesystem path, without creating the file Ben Finney <ben+python@benfinney.id.au> - 2016-02-15 08:46 +1100
  Re: Make a unique filesystem path, without creating the file Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-02-14 23:48 +0100
  Re: Make a unique filesystem path, without creating the file Grant Edwards <invalid@invalid.invalid> - 2016-02-15 15:46 +0000
  Re: Make a unique filesystem path, without creating the file "Mario R. Osorio" <nimbiotics@gmail.com> - 2016-02-15 20:46 -0800
    Re: Make a unique filesystem path, without creating the file Ben Finney <ben+python@benfinney.id.au> - 2016-02-16 16:03 +1100

csiph-web