Skip to content

mktemp: fails with --tmpdir="" #8445

@cakebaker

Description

@cakebaker

When using --tmpdir="" (or -p "") uutils mktemp fails whereas GNU mktemp doesn't.

cargo run -q mktemp -p ""
error: a value is required for '-p <DIR>' but none was supplied

For more information, try '--help'.
$ cargo run -q mktemp --tmpdir=""
error: a value is required for '--tmpdir[=<DIR>]' but none was supplied

For more information, try '--help'.
$ mktemp -p ""
/tmp/tmp.1jOFiMFSXf
$ mktemp --tmpdir=""
/tmp/tmp.qhIpkL93V0

GNU mktemp seems to handle an empty string as if no DIR has been provided: it uses $TMPDIR if set, else /tmp

It's the cause for https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2117715

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions