Giter Site home page Giter Site logo

Comments (6)

msteveb avatar msteveb commented on May 20, 2024

I don't have the environment to be able to reproduce this error, so hopefully you or someone else can resolve it.

from jimtcl.

dbohdan avatar dbohdan commented on May 20, 2024

Right. I made this as a bookmark for myself and in hope someone else might notice.

from jimtcl.

dbohdan avatar dbohdan commented on May 20, 2024

The problem doesn't manifest when the Jim Tcl binary built with MinGW-w64 (jimsh.exe) executes plain Windows console programs like cmd.exe:

C:\msys32\home\User\jimtcl>jimsh.exe -e "exec cmd.exe /c echo hi >> hi.txt"


C:\msys32\home\User\jimtcl>type hi.txt
hi

This suggests the bug may be the result of a normal Windows binary (jimsh.exe) interacting with ones built specifically for the MSYS2 environment (echo.exe), meaning the scope of the bug is narrower than it seemed from the start. One thing to check now is if it is possible to reproduce it with programs other than Jim Tcl starting MSYS2 binaries, i.e., if the bug is specific to Jim Tcl.

Edit: Tcl 8.6.4 and busybox-w32 redirect the output of MSYS2 executables normally, meaning the source code to mainline Tcl's [exec] is worth comparing to Jim's.

from jimtcl.

msteveb avatar msteveb commented on May 20, 2024

The windows code in jim-exec.c is derived in large part from Tcl 8.6
One of the few differences I notice in the create flags that are passed to CreateProcess(). Perhaps Jim needs DETACHED_PROCESS.

from jimtcl.

msteveb avatar msteveb commented on May 20, 2024

I also notice that Tcl doesn't use FILE_APPEND_DATA. Instead after opening, it seeks to the end of the file with:

SetFilePointer(handle, 0, NULL, FILE_END);

from jimtcl.

dbohdan avatar dbohdan commented on May 20, 2024

Great find! Replacing FILE_APPEND_DATA with a call to SetFilePointer fixes all the append-related tests. (DETACHED_PROCESS didn't.) Now only 12.1 remains. I would simply add a unix constraint to it.

PR: #60.

from jimtcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.