delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/09/17/19:59:06

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDD1F398C807
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1600387105;
bh=P7qTSQIgZzSu4FITE3abeCdDXTRUaVxpq1oFrBImA4Q=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=Dho5FxwmQgvisE4tV50G//TAAZ+5aDJN39I563sagIw2sOJmlZ78QpmINH2QzuzBT
WCTllIeeRIfVkgn0yydStldLJhCOH4YU4FprsAVfQaMtrkx/jGOhSA/msV6fkUe/py
mMYIXQzF6hklWyY5k07HRbAxN5AZo3RVjDCpizsY=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BDF023851C25
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=BrDjhKYBYCmBp5pDsyTpYYB22fhgo9S+M2PCOYw2Tlc=;
b=sxifYssK6L+j/bsfvGLVcgTGRcmHVJhHmQRI6aDQjsPqDNIs/DoCrtXdidJvByb/yr
rQ0DaWDuYJEEiTw/RR14Mf4c5KTFb43dlW5YOaCVbvkuQTzXj3j528eTpxl9giZQb5Hy
eGYroMrx0TREmgVzDnYncGN+htAb0mgLunrUhmM3glIIgYF0n+HJllDQa28fPcTffcl7
BGOWDpi8iGG9JxFBxjXOhAAOUQPioB9bv3YRV3voLX8FqihO2tk7APVEWk27yW0Ykb/T
jdyPqSqdrRl6GbBzt++qfJDD/zXx2gLOCAGmXswJC+cjeItHG6LjdDnCq/JY2BHt7pDE
rljA==
X-Gm-Message-State: AOAM5324gbIgZBPwCq6F3KcI4qxbL33YcYySfiAitZNWP14C+u4oClt+
DuT+oH7LG+nNWsII1ZVMDO8/s3O96uxrIqk3zyHB8faFAqOA2w==
X-Google-Smtp-Source: ABdhPJwmkKeXddO99NyhwT3rBwmRLJ3DjfExgXteoe3mnIt8BLZ9vHteMHYv896dbd3eB/BpHsVD9dY6mOSOPIVLCkc=
X-Received: by 2002:a02:8782:: with SMTP id t2mr27794736jai.56.1600387101853;
Thu, 17 Sep 2020 16:58:21 -0700 (PDT)
MIME-Version: 1.0
References: <3423eb8a-447e-015e-9eb7-84d455db0c4f AT towo DOT net>
<F4798AA8-0860-4910-8F48-86C1BAE383DF AT gmail DOT com>
<423c729e-4c66-dd5e-73c0-4c636089ea35 AT cornell DOT edu>
In-Reply-To: <423c729e-4c66-dd5e-73c0-4c636089ea35@cornell.edu>
Date: Thu, 17 Sep 2020 17:58:10 -0600
Message-ID: <CAJ1FpuPx6giEVm52Aa9YfPNzcZAwuHW+Dtw8ofFt12Qp9nTjPg@mail.gmail.com>
Subject: Re: TMP/TEMP environment variable and /tmp
To: cygwin <cygwin AT cygwin DOT com>
X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,
HK_RANDOM_ENVFROM, HK_RANDOM_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Doug Henderson via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Doug Henderson <djndnbvg AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

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>


-- 
Doug Henderson, Calgary, Alberta, Canada - from gmail.com
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019