Greg Ewing wrote: > Gregory P. Smith wrote: >> I prefer the default of "clean up after itself" as is to avoid leaving >> temporary file turds on systems caused by us lazy programmers. > > Maybe instead of an option there should be a separate > function with a different name, such as NewUniqueFile. > For the use cases I have in mind, the file isn't really > "temporary" at all. Or rather, only the name is temporary, > as it ultimately gets renamed. > I'm in favor of adding such a function. I've already wrote my way around this missing feature before. The tempfile modules AFAIK is the only portable way to make a unique filename and open it without exposing a race condition. As it is, it's not that difficult to write this function yourselves using mkstemp directly, but I believe there is a great benefit to have it in the stdlib. -Scott -- Scott Dial scott at scottdial.com scodial at cs.indiana.edu
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4