mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
mktemp: note that windows uses a different env var for tmpdir
On windows `std::env::temp_dir` uses the `TMP` environment variable instead of `TMPDIR`.
This commit is contained in:
parent
e5a7bcbb9d
commit
622504467f
2 changed files with 5 additions and 2 deletions
|
@ -77,14 +77,14 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
.long(OPT_TMPDIR)
|
||||
.help(
|
||||
"interpret TEMPLATE relative to DIR; if DIR is not specified, use \
|
||||
$TMPDIR if set, else /tmp. With this option, TEMPLATE must not \
|
||||
$TMPDIR ($TMP on windows) if set, else /tmp. With this option, TEMPLATE must not \
|
||||
be an absolute name; unlike with -t, TEMPLATE may contain \
|
||||
slashes, but mktemp creates only the final component",
|
||||
)
|
||||
.value_name("DIR"),
|
||||
)
|
||||
.arg(Arg::with_name(OPT_T).short(OPT_T).help(
|
||||
"Generate a template (using the supplied prefix and TMPDIR if set) \
|
||||
"Generate a template (using the supplied prefix and TMPDIR (TMP on windows) if set) \
|
||||
to create a filename template [deprecated]",
|
||||
))
|
||||
.arg(
|
||||
|
|
|
@ -17,7 +17,10 @@ static TEST_TEMPLATE8: &str = "tempXXXl/ate";
|
|||
#[cfg(windows)]
|
||||
static TEST_TEMPLATE8: &str = "tempXXXl\\ate";
|
||||
|
||||
#[cfg(not(windows))]
|
||||
const TMPDIR: &str = "TMPDIR";
|
||||
#[cfg(windows)]
|
||||
const TMPDIR: &str = "TMP";
|
||||
|
||||
#[test]
|
||||
fn test_mktemp_mktemp() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue