From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: getenv problem Date: 17 Dec 2002 16:34:15 GMT Organization: Cornell University Lines: 45 Sender: asu1 AT cornell DOT invalid (on 128.253.251.155) Message-ID: References: <8gvtvuo1qe2qi661n15lf6u1vt69ar7d5j AT 4ax DOT com> NNTP-Posting-Host: 128.253.251.155 X-Trace: news01.cit.cornell.edu 1040142855 20049 128.253.251.155 (17 Dec 2002 16:34:15 GMT) X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu NNTP-Posting-Date: 17 Dec 2002 16:34:15 GMT User-Agent: Xnews/5.04.25 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Wilfried Hennings wrote in news:8gvtvuo1qe2qi661n15lf6u1vt69ar7d5j AT 4ax DOT com: > Right click on "My computer" on your desktop, then "properties", > "extended" (or what else is it in English? I have the German WinXP), it is "Advanced" in the English version. > "environment variables". > There I (logged in with admin rights) see two sets of variables: > User variables and system variables. > "TEMP=C:\DOCUME~1\asu1\LOCALS~1\Temp" comes from the user variables. > "TEMP=c:\windows\temp" comes from the system variables. Yes, I know that. > If I open a command prompt, I get the "user" temp. > But if the djgpp program opens a new process, what variables does this > get??? I don't know! And I myself would like to be a little bit more > enlighted in this respect... I got curious and checked the sources. The code in crt1.c does not give any immediate clues. I suspect most of the work is being done in stub.asm but I am not well versed in the technicalities of PSP's etc and x86 assembly language. I thought maybe variables from my user environment settings were not seen by the djgpp stub code, but they are. I verified this by compiling and running a program that displayed the value of a variable that is only defined in the user environment. My guess at this point is that this maybe a bug in ntvdm or whatever deals with setting up the PSP etc for dos programs in Win XP. I made the following changes to my djgpp.env as a work-around: +TMPDIR=C:\DOCUME~1\%USERNAME%\LOCALS~1\Temp TEMP=%TMPDIR% TMP=%TMPDIR% -- A. Sinan Unur asu1 AT c-o-r-n-e-l-l DOT edu Remove dashes for address Spam bait: mailto:uce AT ftc DOT gov