Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c9bc3ab1ef9cbf1bf8018e3deae3433aea3d0dbe
Ticket: 4ab2ccc4a26e39e630ab96f7e9281b60181ea5e9
auto_exec and exec inconsistent in Windows
User & Date: gerhardr on 2014-12-02 14:52:29
Changes

  1. icomment:
    Tcl/Tk 8.5.15 - TCL bug exec/exec_ok
    
    exepath=C:/TEMP/BAT_Test
    File doesn't exists, creating C:/TEMP/BAT_Test.BAT ...
    execok=C:/TEMP/BAT_Test.BAT, file exists=1
    cmdfile executed: oserrorcode=0, tmp='C:\Temp\BAT_Test started successfully... '
    oserrormsg='C:\Temp\BAT_Test started successfully... '
    
    exepath=C:/TEMP/CMD_Test
    File doesn't exists, creating C:/TEMP/CMD_Test.CMD ...
    execok=C:/TEMP/CMD_Test.CMD, file exists=1
    cmdfile executed: oserrorcode=1, tmp not set
    oserrormsg='couldn't execute "C:\TEMP\CMD_Test.CMD": no such file or directory'
    
    exepath=C:/TEMP/TXT_Test
    File doesn't exists, creating C:/TEMP/TXT_Test.TXT ...
    execok=, file exists=0
    cmdfile executed: oserrorcode=1, tmp not set
    oserrormsg='couldn't execute "": no such file or directory'
    
    === Remarks ===
    Test 1: extension BAT - auto_execok expanding ok, file exists, cmd executed
    Test 2: extension CMD - auto_execok expanding ok, file exists, cmd not executed
    Test 2: extension TXT - auto_execok expanding not ok, further tests fail (ok!)
    
    From the exec manpage: Then, in order, .com, .exe, and .bat are appended ...
    In this case the CMD file must not become expanded by autoexec_ok.
    
    From the auto_execok: Determines whether there is an executable file or shell builtin by the name cmd. If so, it returns a list of arguments to be passed to exec to execute the executable file or shell builtin named by cmd.
    In this case the CMD file must be executable (which is tha case on Windows) and it can also be executed by CMD.exe.
    
    The error message: "... no such file or directory" 
    is definitely not correct as the "file exists" stetes before.
    
    Information: Windows treats all extensions which are shown in the evironment variable PATHEXT as executable (created on some registry entry), e. g.:
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    
  2. login: "gerhardr"
  3. mimetype: "text/plain"
  4. username: "Output of the code"