Skip to content
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

Simplify generation of temporary files #99

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

bbannier
Copy link
Member

@bbannier bbannier commented Oct 2, 2023

Instead of manuall relying in $$ being unique, with this patch we instead use mktemp which creates a unique, temporary file which we can use later. This also removes the possibility that we accidentially overwrite other existing files in the final location, e.g., from previous, failed runs.

Via the default behavior of mktemp with this patch we also switch from forced generation of temporary files in /tmp to possibly $TMPDIR if set.

@bbannier bbannier self-assigned this Oct 2, 2023
Instead of manuall relying in `$$` being unique, with this patch we
instead use `mktemp` which creates a unique, temporary file which we can
use later. This also removes the possibility that we accidentially
overwrite other existing files in the final location, e.g., from
previous, failed runs.

Via the default behavior of `mktemp` with this patch we also switch from
forced generation of temporary files in `/tmp` to possibly `$TMPDIR` if
set.
@bbannier bbannier force-pushed the topic/bbannier/use-mktemp branch from f40cf0f to 22fbdf9 Compare October 2, 2023 08:43
@bbannier bbannier marked this pull request as ready for review October 2, 2023 08:47
@bbannier bbannier requested a review from awelzel October 2, 2023 08:50
btest-diff Show resolved Hide resolved
Copy link
Contributor

@awelzel awelzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit around -t / --tmpdir usage.

@bbannier bbannier merged commit 905c8fe into master Oct 4, 2023
22 checks passed
@bbannier bbannier deleted the topic/bbannier/use-mktemp branch October 4, 2023 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants