-
Notifications
You must be signed in to change notification settings - Fork 122
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 convenient method equivalent toTempDir:new('foo')
#249
Comments
You need to specify a prefix for the tempdir name? Or do you just need to specify a location. If you need to specify a location, |
|
Hm. I don't think I'm on the same page. Could you explain exactly what you're trying to do and the desired effect? |
The desired effect is to recover the behaviour of the old It add + create a folder with the prefix... |
I'll consider it, but a stronger motivation beyond "I want to do this" would be helpful. Personally, I usually care about where my temporary files go, but rarely care about their names. |
Understood. We have a battery of test that run on parallel and we use the same
without causing interferences, and having names help in debugging issues, that is very hard to do if the names are machine generated! Also if used outside the test, this show up in logs and is nicer to see that this particular temp file was part of certain "context". |
Yeah, that makes sense. My concern is that I could add Yeah, ok, I should probably just do it. Now to the question of names:
I'm thinking the first one. |
Yes |
- `TempDir::with_prefix(prefix)` - `TempDir::with_prefix_in(prefix, directory)` - `TempFile::with_prefix(prefix)` - `TempFile::with_prefix_in(prefix, directory)` fixes #249
- `TempDir::with_prefix(prefix)` - `TempDir::with_prefix_in(prefix, directory)` - `TempFile::with_prefix(prefix)` - `TempFile::with_prefix_in(prefix, directory)` fixes #249
- `TempDir::with_prefix(prefix)` - `TempDir::with_prefix_in(prefix, directory)` - `TempFile::with_prefix(prefix)` - `TempFile::with_prefix_in(prefix, directory)` fixes #249
I want to remove the dependabot for GHSA-mc8h-8q98-g5hr and I miss the old
TempDir:new('foo')
call.The available constructors have different semantics and the proposed solution is kinda verbose:
tempfile::Builder::new().prefix(prefix).tempdir()
The text was updated successfully, but these errors were encountered: