Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #103387
| From | Jon Ribbens <jon+usenet@unequivocal.co.uk> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Make a unique filesystem path, without creating the file |
| Date | 2016-02-23 00:53 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrnncnbii.16b.jon+usenet@wintry.unequivocal.co.uk> (permalink) |
| References | (3 earlier) <85mvr26dij.fsf@benfinney.id.au> <56CB4F60.4010201@stoneleaf.us> <85povoz7hg.fsf@benfinney.id.au> <CAHVvXxQH3-u6HW0w+OCeFoDtjnmrFDQTLFft4CkU8TEQ8nynUg@mail.gmail.com> <mailman.56.1456187612.20994.python-list@python.org> |
On 2016-02-23, Ben Finney <ben+python@benfinney.id.au> wrote: > Oscar Benjamin <oscar.j.benjamin@gmail.com> writes: >> What does unpredictable mean in this context? Maybe I'm reading too >> much into that... > > I think you may be, yes. The request in this thread requires making > direct use of the “generate a new valid temporary fielsystem path” > functionality already implemented in ‘tempfile’. > > Implementations of that functionality outside of ‘tempfile’ are a fun > exercise, but miss the point of this thread. I think you have missed the point of your own thread. You can't do what you wanted using tempfile, the only possible answer is to choose a filename that is sufficiently random that your hope that it is unique won't be proven futile. tempfile has two main modes, mktemp which meets your requirements but should never be used as it is insecure, and mkstemp which doesn't meet your requirements because it fundamentally operates by actually creating the file in question and relying on the filesystem to guarantee uniqueness.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Make a unique filesystem path, without creating the file Ben Finney <ben+python@benfinney.id.au> - 2016-02-23 11:18 +1100 Re: Make a unique filesystem path, without creating the file Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-02-23 00:53 +0000
csiph-web