delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/01/11:32:58

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <b610e770a6f8ab524e0df3c9ce625e84.squirrel@mail.morrison.mine.nu>
References: <4B14573C DOT 3040409 AT alice DOT it> <a13b5a590911301753w74ccf298g669e55fc58d36c50 AT mail DOT gmail DOT com> <20091201091515 DOT GC30043 AT calimero DOT vinschen DOT de> <b610e770a6f8ab524e0df3c9ce625e84 DOT squirrel AT mail DOT morrison DOT mine DOT nu>
Date: Tue, 1 Dec 2009 11:32:43 -0500
Message-ID: <a13b5a590912010832t52d7ed9cjd2c093ac7d6ea9a4@mail.gmail.com>
Subject: Re: Unset TMP/TEMP in profile? (was Re: [ANNOUNCEMENT] [1.7] Updated: cygwin-1.7.0-67)
From: Robert Pendell <shinji AT elite-systems DOT org>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Tue, Dec 1, 2009 at 5:44 AM, John Morrison wrote:
> On Tue, December 1, 2009 9:15 am, Corinna Vinschen wrote:
>> On Nov 30 20:53, Robert Pendell wrote:
>>> On Mon, Nov 30, 2009 at 6:37 PM, Angelo Graziosi
>>>wrote:
>>> > Robert Pendell wrote:
>>> >>
>>> >> P.S. - On linux (when I tested) TEMP, TMP, and TMPDIR were not set
>>> and
>>> >> patch defaulted to /tmp.
>>> >
>>> > I noticed that too...
>>> >
>>> > Ken Brown wrote:
>>> >>
>>> >> That's precisely why I suggested unsetting TEMP and TMP in
>>> /etc/profile.
>>> >> Then things should work as in linux.
>>> >
>>> > Indeed. But a question emerges: what does it happen if one starts a
>>> Windows
>>> > application, which needs TEMP or TMP, from Cygwin?
>>> >
>>> > For example, GSview (*) can view ps.bz2 or pdf.bz2 files uncompressing
>>> them
>>> > into $TEMP, so it fails if TEMP is not defined, and
>>> >
>>> > $ gsview foo.pdf.bz2
>>> >
>>> > is broken!
>>> >
>>> > This is only an example of problems which can emerge unsetting TEMP.
>>> >
>>> > Ciao,
>>> > Angelo.
>>> >
>>>
>>> Actually I had thought about that and I found that if you
>>> intentionally unset all the variables it defaults back to the system
>>> defined one which is dependent on the current user in Windows.
>>> Basically what TEMP and TMP is defined to in Windows itself. =C2=A0This=
 is
>>> like the behavior in Linux.
>>
>> I'm wondering if /etc/profile is actually the right place for unsetting
>> TMP and TEMP. =C2=A0What about etc/defaults/etc/skel/.bashrc instead? =
=C2=A0It
>> allows every user simple access to the setting of TMP and TEMP and it
>> could be seasoned with a user-visible comment.
>
> Unsetting them in the skel .bashrc files shouldn't be a problem to do, but
> on my system...
>
> $ echo $TMP
> /cygdrive/c/DOCUME~1/morrijr/LOCALS~1/Temp
>
> Tue Dec 01 10:40 AM
> $ unset TMP
>
> Tue Dec 01 10:40 AM
> $ echo $TMP
>
>
> Tue Dec 01 10:40 AM
> $
>
> They don't get 'reset' to the windows default... but then, I've not really
> been following this thread. =C2=A0Is that what's wanted?
>
> Also, $PATCH and $TMPDIR weren't defined on my system anyway...
>
> J.
>

They are not reset but during an strace I discovered that cygwin will
internally default to the system defined TEMP if one isn't defined in
cygwin.  In other words if it has been unset.  This is similar to
linux using /tmp by default if none is defined at all.

Robert Pendell
shinji AT elite-systems DOT org
CAcert Assurer
"A perfect world is one of chaos."

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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