X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 50881395182D
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=t-online.de
Authentication-Results: sourceware.org;
 spf=none smtp.mailfrom=HBBroeker@t-online.de
Subject: Re: TMP/TEMP environment variable and /tmp
To: cygwin@cygwin.com
References: <025401d68c06$9a89e8b0$cf9dba10$@gmail.com>
 <CAB8Xom9qowtQ+Jq1Z4tOxCHrVAugNyQ7UpVT3gXm1yJ9yj=bfg@mail.gmail.com>
 <202459f2-75cc-1ac2-7953-67f98e6fdb35@towo.net>
From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= <HBBroeker@t-online.de>
Message-ID: <9e5ab93b-9b0b-6855-d5da-365da48ecce2@t-online.de>
Date: Wed, 16 Sep 2020 21:27:20 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
 Thunderbird/68.12.0
MIME-Version: 1.0
In-Reply-To: <202459f2-75cc-1ac2-7953-67f98e6fdb35@towo.net>
Content-Language: en-US
X-ID: EYWpl8ZYZhgU-lqbK945pc3UuTZvFbgkU0CiuCmDPIy-ktWI984UnYVAUJUr6+-g+X
X-TOI-EXPURGATEID: 150726::1600284439-0000418D-0CBFA89B/0/0 CLEAN NORMAL
X-TOI-MSGID: e17fe9f6-376a-42e0-b099-b90164037ee0
X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM,
 KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
 RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE,
 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@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 08GJRpxv004275

Am 16.09.2020 um 13:12 schrieb Thomas Wolff:
> Am 16.09.2020 um 13:04 schrieb marco atzeri via Cygwin:
>> On Wed, Sep 16, 2020 at 10:53 AM Kristian Ivarsson via Cygwin

>>> 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.

A bigger part of the reason may have been what the result of that 
platform-dependent query would have been, back when the decision had to 
be made.  For several releases you would have ended up with (your 
locally translated version of!) stupid old "Documents and Settings" as 
part of the pathname, and possibly some extra blanks and special 
characters from the user name, on top of that.

And I for one really do not trust that a Unix temp directory can safely 
have white space in its name without breaking lots of tools' behavior in 
nastily interesting ways.  IIRC it took until Windows 8 for Microsoft to 
finally own up to their error and change it to the profoundly less 
insane "Users".  But by then it was too late, all the damage had been 
done already.
--
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

