From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: TMP/TEMP environment variable and /tmp
Date: Thu, 17 Sep 2020 22:17:59 -0400 [thread overview]
Message-ID: <687db96b-9f7e-8c50-4673-14435a20864b@cornell.edu> (raw)
In-Reply-To: <CAJ1FpuPx6giEVm52Aa9YfPNzcZAwuHW+Dtw8ofFt12Qp9nTjPg@mail.gmail.com>
On 9/17/2020 7:58 PM, Doug Henderson via Cygwin wrote:
> On Thu, 17 Sep 2020 at 15:56, Ken Brown via Cygwin <> wrote:
>>
>
> #include <stdio.h>
> #include <stdlib.h>
> int
> main ()
> {
> char *temp_nam;
> char *p_tmp_nam;
>
> printf ("$TMP is '%s'\n", getenv ("TMP"));
> printf ("$TMPDIR is '%s'\n", getenv ("TMPDIR"));
> printf ("$TEMP is '%s'\n", getenv ("TEMP"));
> printf ("P_tmpdir is '%s'\n", P_tmpdir);
> p_tmp_nam = tmpnam(0);
> printf ("tmpnam() is '%s'\n", p_tmp_nam);
> temp_nam = tempnam(0, 0);
> printf ("tempnam() is '%s'\n", temp_nam);
> free(temp_nam);
> }
>
>
> # start a new shell
> $ sh
> $ TMP= TEMP= ./show_tmp
> $TMP is ''
> $TMPDIR is '(null)'
> $TEMP is ''
> P_tmpdir is '/tmp'
> tmpnam() is '/tmp/t707.0'
> tempnam() is '/tmp/ffffd187.2'
>
> # start cmd.exe
> $ /cygdrive/c/windows/system32/cmd.exe
> Microsoft Windows [Version 10.0.18363.1082]
> (c) 2019 Microsoft Corporation. All rights reserved.
>> set TMP=
>> set TEMP=
>> show_tmp
> $TMP is '(null)'
> $TMPDIR is '(null)'
> $TEMP is '(null)'
> P_tmpdir is '/tmp'
> tmpnam() is '/tmp/t709.0'
> tempnam() is '/tmp/ffffd189.2'
>
> P_tmpdir is defined in <stdio.h>
Sorry, but I'm missing your point. How is this related to Kristian's claim that
Cygwin is changing the value of the TMP environment variable to "/tmp"?
Ken
next prev parent reply other threads:[~2020-09-18 2:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 8:51 sten.kristian.ivarsson
2020-09-16 11:04 ` marco atzeri
2020-09-16 11:12 ` Thomas Wolff
2020-09-16 19:27 ` Hans-Bernhard Bröker
2020-09-17 12:12 ` Sv: " sten.kristian.ivarsson
2020-09-17 15:23 ` Thomas Wolff
2020-09-17 21:07 ` Kristian Ivarsson
2020-09-17 21:55 ` Ken Brown
2020-09-17 23:58 ` Doug Henderson
2020-09-18 2:17 ` Ken Brown [this message]
2020-09-18 3:56 ` Brian Inglis
2020-09-18 5:56 ` Kristian Ivarsson
2020-09-18 13:15 ` Brian Inglis
2020-09-21 7:57 ` Sv: " sten.kristian.ivarsson
2020-09-20 7:20 ` Andrey Repin
2020-09-17 16:13 ` Ken Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=687db96b-9f7e-8c50-4673-14435a20864b@cornell.edu \
--to=kbrown@cornell.edu \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).