-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic tempfile API to stdlib #420
Comments
Yes the Also the OS-managed In any case if the team feels that |
I'd want to do this incrementally, by first adding the most simple APIs.
Thanks, that is indeed better! |
cc @kennytm I just added the API you wanted for named tempfile/tempdir. I think the core of it is |
where's |
Thanks @programmerjake updated, it should be |
also note that os-managed tempfiles may not be available on every platform, while rust-managed tempfiles can work on any platform where files can be deleted. |
Note that all of these are true of literally every piece of code ever, which makes them weak motivation for this change since it's not true that all code should be in the standard library. What makes it important that this specifically be in |
@scottmcm tl;dr tempfile API is a missing pieces in stdlib
In additional to that:
|
@scottmcm Let's think about this the other way around: Why tempfile should not be part of stdlib? If we are developing a new PL, if there any reason tempfile should not be in stdlib? It is a quite fundamental functionality, abstracts over platform details, and has a stable API, and there's no different way to implement it, except for some tunables. |
if tempfile should be in stdlib, doesn't require a portable interface to the system RNG? |
stdlib already has it internally, and there's proposal to expose that. |
We did a first-pass discussion about this in today's @rust-lang/libs-api meeting. We didn't come to a consensus yet, but some initial reactions were that some of the methods (e.g. |
Proposal
Problem statement
Tempfile is a widely used functionality, with the previous breaking change of the
tempfile
crate being about 7 years ago, I believe its API is stable enough that it should be part of the stdlib.Motivating examples or use cases
The crate
tempfile
has 168,118,646 downloads and is used very often in the ecosystem, I believe it is quite a fundamental functionality that the ecosystem depends on.Having it in stdlib would make it
Solution sketch
Once we have the basics done, we can add it more methods from
tempfile
, i.e. the named tempfile, the temp dir, etc.Links and related work
tempfile
, the existing popular implementation of tempfile.The text was updated successfully, but these errors were encountered: