Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c1201747f77c2e47095cc95e5bb6112228916a18
Ticket: 914108ffffffffffffffffffffffffffffffffff
windows: exec doesn't find symlink without full path
User & Date: p_samson on 2004-06-06 15:48:45
Changes

  1. icomment:
    Logged In: YES 
    user_id=994002
    
    Well, I had to browse deeper in code, and strace.exe the runs
    to know more.
    First let's correct some of my wrong previous assertions:
    - Forget tclUnixPipe.c and execvp(). For the cygwin package
    tclWinPipe.c is used.
    - Forget what I wrote about lpApplicationName. Even directly
    from bash, a CreateProcess() is called with
    lpApplicationName = "C:\cygwin\bin\gzip.exe"
    lpCommandLine="C:\cygwin\bin\gzip.exe /tmp/some.gz"
    
    Now, what I think is the explanation:
    bash uses spawn.cc. CreateProcess() is called in spawn_guts()
    of this source, with extra information in
    lpStartupInfo.lpReserved2 (which should be NULL for a
    MSC Runtime exe).
    This info will provide the argv for the child process, but
    with the replacement of argv[0]:
     newargv.replace0_maybe (prog_arg);
    That's how gzip.exe gets its arg[0] as "/bin/gunzip.exe".
    
    Note: the cygwin starter also supports lpReserved2 as NULL,
    but then all this wizardry for arg[0] is missing.
    
    I guess there is no way for TCL to satisfy these cygwin
    internals, so I'm on my own to replace every "gunzip" with
    "gzip -d" in the tcl-based open source products I use.
    And for any !<symlink> form of exe as well.
    
    Thanks anyway to all for your comments and assistance.
    
    
    
  2. login: "p_samson"
  3. mimetype: "text/plain"
  4. username: "p_samson"