Matt Wheeler <m...@funkyhat.org> writes:

> On 14 Feb 2016 21:46, "Ben Finney" <ben+pyt...@benfinney.id.au> wrote:
> > 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?
>
> Could you use tempfile.TemporaryDirectory and then just use a
> consistent name within that directory.

That fails because it touches the filesystem. I want to avoid using a
real file or a real directory.

> It's guaranteed not to exist

I am unconcerned with whether there is a real filesystem entry of that
name; the goal entails having no filesystem activity for this. I want a
valid unique filesystem path, without touching the filesystem.

-- 
 \             “I believe our future depends powerfully on how well we |
  `\     understand this cosmos, in which we float like a mote of dust |
_o__)                 in the morning sky.” —Carl Sagan, _Cosmos_, 1980 |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to