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

Add template to mktemp to fix #175 #176

Merged
merged 1 commit into from
Feb 8, 2015

Conversation

abarnert
Copy link
Contributor

@abarnert abarnert commented Feb 8, 2015

See #175. Briefly, mktemp -d with no other parameters is only legal on the GNU version of mktemp, not the BSD version; explicitly passing the GNU version's default works on both.

tomerfiliba added a commit that referenced this pull request Feb 8, 2015
Add template to `mktemp` to fix #175
@tomerfiliba tomerfiliba merged commit bae68b7 into tomerfiliba:master Feb 8, 2015
@9999years
Copy link

The template, at least on the GNU version of mktemp, is interpreted as a plain filename, not considering $TMPDIR or /tmp, unless -p is also passed -- can we make this feature work on BSD and GNU? The current solution places all temp dirs in the current working directory, which is sub-optimal.

henryiii pushed a commit that referenced this pull request Dec 23, 2021
…#571)

Try to use `mktemp -d` before falling back to calling mktemp with an
explicit template (for compat. with some BSD variants of mktemp
(see #176)).

Testing shows shows that this fixes temp dirs being created in the
current working directory on systems using a recent current GNU
coreutils mktemp variant and on systems using the mktemp variant
packaged with some macOS versions (e.g. 10.15). This may also fix the
issue on other systems as well (see
https://stackoverflow.com/a/2792789).
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.

3 participants