delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/09/17/17:56:30

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F7393945C2B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1600379742;
bh=RenihFriXpd6INtvKN2eH39FEjw9b//5Eb7x4J5Rk3g=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=cQ5B3or7tzRUC/cFWKXHKjPa0hum7Qsar2aWkf6uaDM8tJyaxH0m1EfM1KgR6iJaO
mApQ422EV1SKdgtp3Xtiym00bcwsQ5RwtluvAvKnPEfYVrgPjV1ovczv+UkYqWd7ds
WOv71Hq1BNlxp9S0Csk9nrzJdeod7+E+ziWTdk9E=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 104EC3870902
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=TGJXr/LDfXOuiLKeZZ+QpqNpox50LR0hbsFb5w4PviYnbnfVtwuGBputnJvWyLE89SIgRA+yZtwnSIu7nqbFkwIq1hrtwKgda0Q2EeSN4kBNqvQim30cSoX3JLX/+BH5+/hZ1Co3fur1zh0VsZnEErfYZz+bl+DBZSTiqJGU/tUvdgNg78SkbFZEYnh/0+P8FEKjKRCZj/RkhbtdKcgP7Bd42/0K75JWcbfZKktEL6zRfkkD7cPFuAFhV2tUM+G79+Cmk2d8FfSwGqPnZ6f+MTQKEJavq+/jxRuhCasn7m3aPzs1aEhKJaqhStWiQI14k8lCBCyp/l2ozSlH855QJg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=UXaX02yjJkSiQ5/JQVbF/dZ9sblWqQT0lZxXXYsMPUI=;
b=EuWVQlCF0NPPA3q4T3sXIfBmj/ejyobQ5EvAxlfd518T3879HNrqEqXSieiM/9p8988sZMe3HBE3cJVvZC4w82iWOEkEFGCQ9yG2AEcOQFGEB8b4reiqJPrc4Kqx6ZAFAVdNS5k1OFw92H4nJbk9f2cCFdinquJk00X8stNptEwnNYdFQFEX472lTa0bjsWYZfqZPwOZDiUY/BG9OT+/KW19v092Sw0XRXGJgX1SIa6G+nBnf9CD1G9W/NLnc9oQ6PY8A/gvVCE2TUI1F9yXuwJ0xts2WQG3vUJrCUuNv3FTV6ObbyNT+fcteT5E9njOtGgZmzNJH6PwxezBsmr03A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu;
dkim=pass header.d=cornell.edu; arc=none
Subject: Re: TMP/TEMP environment variable and /tmp
To: Kristian Ivarsson <sten DOT kristian DOT ivarsson AT gmail DOT com>
References: <3423eb8a-447e-015e-9eb7-84d455db0c4f AT towo DOT net>
<F4798AA8-0860-4910-8F48-86C1BAE383DF AT gmail DOT com>
Message-ID: <423c729e-4c66-dd5e-73c0-4c636089ea35@cornell.edu>
Date: Thu, 17 Sep 2020 17:55:35 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.12.0
In-Reply-To: <F4798AA8-0860-4910-8F48-86C1BAE383DF@gmail.com>
X-ClientProxiedBy: CH2PR18CA0038.namprd18.prod.outlook.com
(2603:10b6:610:55::18) To MN2PR04MB6176.namprd04.prod.outlook.com
(2603:10b6:208:e3::13)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-Originating-IP: [68.175.129.7]
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: da3f84bf-530b-406d-4c43-08d85b546982
X-MS-TrafficTypeDiagnostic: MN2PR04MB5744:
X-Microsoft-Antispam-PRVS: <MN2PR04MB5744662E79092BD8231437D5D83E0 AT MN2PR04MB5744 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Oob-TLC-OOBClassifiers: OLM:10000;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: 4yy/VLzZ/gckHvBn006jb43zgn4hYp6VYdrpYKiY3PIX1Eupez365ss8IBXzJxCeCyDbwxqr9Xl0jHtkahowJDDp9YDZZjbuFFgVeGgWwdlZWXBhF7wkEwHr4UM8rBq2IPXDvqlHUsTZdIMkycoppTLSp5bdUuPzjVxpcH8AIu3UxEFnfA5oflFY+fmmvDvwZ1m/hX0isQXaW9a3v12GlPQvGkpuTRIDIU3Tdeh2Shdv+6HJM9pzwuY5sOQ//E5EkJQLcJCc01OhL169PmXAk0Bt0SFDMLhSbfD8g2n4iScVkmmEmG7k5brf/pu+Fv37EKEwqcByS9NEHgOUwkKAXZD4v2K9+swcPbkQ869ZsSVFMjbEURFQkJeHjRiZXlmh
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:MN2PR04MB6176.namprd04.prod.outlook.com; PTR:; CAT:NONE;
SFS:(4636009)(396003)(376002)(366004)(136003)(39860400002)(346002)(956004)(786003)(2906002)(2616005)(316002)(26005)(31686004)(186003)(31696002)(8936002)(16526019)(83380400001)(478600001)(4326008)(5660300002)(53546011)(86362001)(8676002)(66946007)(52116002)(66556008)(75432002)(6916009)(6486002)(66476007)(36756003)(16576012)(43740500002);
DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData: eWx3HEIUfe7q9egEXjkWi9jwtOseWs0Ebwwx2BtQZkRO+29vQV87OzTRTBY6iKtq06cShe2mCdTOnfFemyhVSGCyX+MtBPxHmDIAp306spy0G/ocohv7/26slVJNScmvp4CoZ9WdOJ6NSFaZTP1g77jnX829VdRTzztJpmUMgDGpnQZy2VY0gDjZGcc/Q0V8XsGSFAWgNBRwONVhNF34GVVQkwRagBG1+E/Oq+s+C6v62Z8/u7AZd8aDsy+A71qMj4cvDL4XGTPFfV0JMvaoGE/emmReITRFnX2COl1Sble1iTlc5uNl2RzeZnG61KsFjLMAHF5x2UhqBqfq2/ommTADyrAcStjS3FGJaMzlA9MMV3RIGPJM5H1B2Fxiy9uN1xECtYLbAa+1kQr5akR6XcNHWFXUlMr9IAjpNUr8IDicY4caQWk+LkPNTmVje3e/mVu6lJYsF2KTF4Afo9VR4mdxYjv66SUsFZ6jotu9nBO7iauUnOhDx7IiQffXaHqZtlWcMycQt9zyY8uvUfy6Z7uWvbkKONRyzb+8uFi9NWSbdvks5OleiqMuw3sdJSxXG4/Novppfz35C+Q1CipH6HbqHQijBKbGpVS4idPedD8tS+8sEQKgz4rSHq6zfh4iwt/IqLuHVYd4Ece/OV3BHg==
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: da3f84bf-530b-406d-4c43-08d85b546982
X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2020 21:55:38.0381 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: fpwFgNmSjbtgAoHVvAtj5p6IzIUB9HObPwZc+cTQ3pCDTZ6QsQPFH8G+kW3zoC2mhS5ERINn0Uyfbs1qJwf7LQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5744
X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_INVALID,
DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A,
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
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: Ken Brown via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Ken Brown <kbrown AT cornell DOT edu>
Cc: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 08HLu9c2011458

On 9/17/2020 5:07 PM, Kristian Ivarsson via Cygwin wrote:
> 
>>>>>>> Does anyone know the rational with this behaviour and what can be
>>>>>>> done to get hold of the (real) Windows TMP/TEMP
>>>>>>> environment-variable-values (in a
>>>>>>> (hopefully) platform independent way) ?
>>>>>> so if you are making your custom tree, try to stick on that
>>>>>> expectation and have both directories.
>>>>> In general, you are free to set TMP to a directory of your choice,
>>>>> that's the purpose of that variable, no need to sync it with some root.
>>>>> There is a comment in /etc/profile:
>>>>>     # TMP and TEMP as defined in the Windows environment
>>>>>     # can have unexpected consequences for cygwin apps, but it does not
>>>>> explain what consequences that might be; probably some trouble with
>>>>> ACL/access permissions for temporary files.
>>>> Nowadays that would be $LOCALAPPDATA/Temp, or if you really insist, the
>>>> content of /proc/registry/HKEY_CURRENT_USER/Environment/TMP (or TEMP),
>>>> after similarly expanding environment variable references found in that.
>>>>
>>>> The fact that getting Windows' idea of the user's TEMP directory is not
>>>> immediately platform independent may well have been part of the rationale
>>>> for not even trying that.
>>>
>>> Well, at least it's up to the user
>>>
>>> If the user sets its TMP-variable to "C:\Jabba Dabba Dooo" or "/jabba dabba doo", I expect the value of getenv("TMP") should be just that and regardless of OS the value returned is whatever the variable is set to and not magically changed to "/tmp"
>> Of course and that's not happening, no worries. The issue was that TMP is set in /etc/profile and not inherited from the Windows environment.
> 
> Well, where my Cygwin-compiled-application is running, there’s no Cygwin-installation and thus no /etc/profile so it cannot be set there (if /etc/profile is not a built in resource in every executable), so there must be some text-value inside the compiled executables used in some manner somehow

There must be something going on in your environment that you haven't told us 
yet.  I just tried the following test case:

#include <stdio.h>
#include <stdlib.h>
int
main ()
{
   printf ("The value of TMP is %s\n", getenv ("TMP"));
}

In a Cygwin bash shell I get

   The value of TMP is /tmp

Running the same executable under a Windows Command Prompt, I get

   The value of TMP is /c/Users/kbrown/AppData/Local/Temp

So Cygwin converts TMP to a Posix path [*], but it doesn't change it to "/tmp".

Ken

[*] See environ.cc:303 for a list of environment variables that Cygwin converts.
--
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