Hi Audrey.

Here's an example of what's going on:

>>: export TMPDIR=/cygdrive/c/tmp/jd
>>: export TMPDIR2=/cygdrive/c/tmp/jd2
>>: cmd.exe
Microsoft Windows [Version 10.0.22621.1105]
(c) Microsoft Corporation. All rights reserved.

C:\>echo %TMPDIR%
C:\tmp\jd

C:\>echo %TMPDIR2%
/cygdrive/c/tmp/jd2

So, if I set TMPDIR and TMPDIR2 in bash, and then call cmd.exe then TMPDIR
is changed to c:\tmp\jd but TMPDIR2 is left as /cygdrive/c/tmp/jd2

I was hoping that there's something I can do to get the following in
cmd.exe:

C:\>echo %TMPDIR2%
C:\tmp\jd2                                              # TMPDIR2 "mapped"
to c:\.... in the same way that TMPDIR is

I hope that's a clearer example.

Note that the actual use case is calling other Win32 programs, and the
environment variable name is different, but the above example is an attempt
to simplify the repro.
$PATH is mapped in  a similar way. So I assume that there is a list of names
which are mapped. I'd like to be able to add my own names to that list.

Thanks.
John.



-----Original Message-----
From: Andrey Repin <anrdae...@yandex.ru> 
Sent: 27 January 2023 07:45
To: john daintree <jo...@dyalog.com>; cygwin@cygwin.com
Subject: Re: TMP and TMPDIR mapping

Greetings, john daintree!

> My understanding is that Cygwin maps $TMP and $TMPDIR (and probably
others)
> to a Windows form (/cygdrive/c/tmp  -> C:\tmp)

Nop. The actual mapping depends on your settings, but defaults to /tmp which
is inside Cygwin installation root.
Another option is to mount /tmp with 'usertemp' option, which would then
redirect it to the user's %TEMP%.

> when calling a WIN32 program
> (e.g. cmd.exe). Is it possible, from bash or from Cygwin startup , to
add
> additional environment variable names so that they  are also
automatically
> mapped in the same way?

What is your question, exactly?
What you want to achieve and what your actual observation compared to
expected behavior?


--
With best regards,
Andrey Repin
Friday, January 27, 2023 10:41:46

Sorry for my terrible english...



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

Reply via email to