Re: Windows env-Bug?
- From: Torsten Edler <Torsten.Edler@xxxxxxxxxxxxxx>
- Date: Sun, 22 Jul 2007 02:28:43 -0700
On 21 Jul., 20:33, Helmut Giese <hgi...@xxxxxxxxxxxxx> wrote:
On Sat, 21 Jul 2007 13:31:04 -0000, Torsten Edler
<Torsten.Ed...@xxxxxxxxxxxxxx> wrote:
This not a tcl feature - this is a windows feature. Try this at the
windows prompt
set XX=AA
is setting the variable to value AA. can be checked by using
set
and unsetting the variable can be done by
set XX=
which is setting the variable to empty string - and in windows this
means deleting the variable! Again another check will confirm that the
variable XX is gone. Same can be done in TCL via the env array and
using parray.
While this is true, the fact that
set env(Test) ""
info exists env(Test)
returns '1' is certainly unfortunate.
It seems that
set env(Test) ""
set Tcl's copy of 'env' to "" - which is perfectly legal for a Tcl
array, thus causing [info exists] to return '1' - but when trying to
retrieve this supposedly existing element, Tcl seems to go out asking
Windows for the value - and for Windows it doesn't exist any more.
Probably it would be quite messy to fix this.
Just my 0.02
Helmut Giese
Still stranger: when you do an "array names env" before "info exists
env(Test)" it vanishes in TCL.
(bin) 38 % info patchlevel
8.4.13
(bin) 39 % set env(Test) "X"
X
(bin) 40 % info exists env(Test)
1
(bin) 41 % set env(Test) ""
(bin) 42 % info exists env(Test)
1
(bin) 43 % array names env
HOME PROCESSOR_IDENTIFIER ComSpec DEVMGR_SHOW_DETAILS
DEVMGR_SHOW_NONPRESENT_DEVICES JSERV HOMEDRIVE ALLUSERSPROFILE
FP_NO_HOST_CHECK SESSIONNAME PROCESSOR_REVISION PATHEXT LOGONSERVER
VS80COMNTOOLS USERDOMAIN PROCESSOR_LEVEL DEFAULT_CA_NR USERPROFILE
USERNAME COMPUTERNAME TREECTRL_LIBRARY TMP SystemRoot
PROCESSOR_ARCHITECTURE OS ProgramFiles APPDATA CommonProgramFiles
WV_GATEWAY_CFG windir Path TEMP HOMEPATH VU_LIBRARY SystemDrive
PERL5LIB NUMBER_OF_PROCESSORS
(bin) 44 % info exists env(Test)
0
(bin) 45 %
.
- Follow-Ups:
- Re: Windows env-Bug?
- From: Gerhard Reithofer
- Re: Windows env-Bug?
- From: Helmut Giese
- Re: Windows env-Bug?
- References:
- Windows env-Bug?
- From: Gerhard Reithofer
- Re: Windows env-Bug?
- From: Torsten Edler
- Re: Windows env-Bug?
- From: Helmut Giese
- Windows env-Bug?
- Prev by Date: Re: files created, filled, incremented
- Next by Date: Re: Windows env-Bug?
- Previous by thread: Re: Windows env-Bug?
- Next by thread: Re: Windows env-Bug?
- Index(es):
Relevant Pages
|