Ben Finney wrote:
One valid filesystem path each time it's accessed. That is, behaviour
equivalent to ‘tempfile.mktemp’.

My question is because the standard library clearly has this useful
functionality implemented, but simultaneously warns strongly against its
use.

But it *doesn't*, if your requirement is truly to not touch
the filesystem at all, because tempfile.mktemp() *reads* the
file system to make sure the name it's returning isn't
in use.

What's more, because you're *not* creating the file, mktemp()
would be within its rights to return the same file name the
second time you call it.

If you want something that really doesn't go near the file
system and/or is guaranteed to produce multiple different
non-existing file names, you'll have to write it yourself.

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

Reply via email to