Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-05
08:20 • Ticket [224021ffff] search path of exec command under C:\Program Files stat... artifact: 0bd530caae user: dgp
2001-03-28
13:53 • Ticket [224021ffff]: 3 changes artifact: 9da0ee3c3e user: dgp
08:50 • Closed ticket [224021ffff]. artifact: c9e49c126e user: hobbs
2001-02-01
03:56 • Ticket [224021ffff]: 1 change artifact: 946a8500ab user: dkf
2000-12-01
10:17 • New ticket [224021ffff]. artifact: 4db3097d92 user: nobody

search path of exec command under C:\Program Files

Closed / Works For Me224021ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-12-01 10:17:17
#------------------------------------------------------------------------------
#   File:       exec_test.tcl  
#------------------------------------------------------------------------------
# simple test proc to show the behaviour of exec and its search path on windows NT
#
# 1. Copy the script to some directory e.g. C:\My Documents
#    add a program e.g. echo.exe
#
# 2: observe, that the function works as expected. All test cases are successful
#
# 3. copy the script and your program under c:\Program Files
#
# 4. see that the script fails in CASE1 and CASE2!!
#
###############################################################################

# define a program which is located in the same directory as this script
set prog echo

# show the console
console show
# make sure the search path is set 
set env(PATH) "$env(PATH);[pwd]"

##-----------------------------------------------------------------------------
## Begin: test case find the program through search path
##-----------------------------------------------------------------------------
if {[catch {set out [exec $prog "CASE1: found the program"]} res]} {
   puts "CASE1: ERROR: $res"
   puts "ENV: $env(PATH)"
   
} else {
    puts $out
}

if {[catch {set out [exec $prog.exe "CASE2: found the program"]} res]} {
   puts "CASE2: ERROR: $res"
   puts "ENV: $env(PATH)"
} else {
    puts $out
}

if {[catch {set out [exec [pwd]/prog.exe "CASE3: found the program"]} res]} {
   puts "CASE3: ERROR: $res"
} else {
    puts $out
}
dkf Ticket [224021ffff]: 1 change [History diff]2001-02-01 03:56:39
hobbsplain2001-03-28 08:50:54
Logged In: YES 
user_id=72656

I cannot repeat this in the simpler case with tclsh and an 
echo.bat that simply says:

---8<---8<---
@echo off
echo here we are %*
---8<---8<---

Note the above program has some errors (like the calling of 
prog in case 3).  There may have been other interactions 
which caused the failure (or a better example is needed).
dgp Ticket [224021ffff]: 3 changes [History diff]2001-03-28 13:53:42
dgp Ticket [224021ffff]: 3 changes [History diff]2001-04-05 08:20:11
Log in (anonymous is fine) to add a comment.