Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Conquest is easy. Control is not. -- Kirk, "Mirror, Mirror", stardate unknown


devel / comp.lang.tcl / Re: bat file execution

SubjectAuthor
* bat file executionJacob
+* Re: bat file executionsaitology9
|`* Re: bat file executionJacob
| `* Re: bat file executionAnonymous
|  `* Re: bat file executionet99
|   `- Re: bat file executionet99
+* Re: bat file executionRich
|`* Re: bat file executionet99
| `* Re: bat file executionJacob
|  `* Re: bat file executionHarald Oehlmann
|   `- Re: bat file executionJacob
+* Re: bat file executionRalf Fassel
|`* Re: bat file executionJacob
| +* Re: bat file executionet99
| |`* Re: bat file executionJacob
| | `- Re: bat file executionet99
| `* Re: bat file executionRalf Fassel
|  `* Re: bat file executionJacob
|   +* Re: bat file executionRalf Fassel
|   |`* Re: bat file executionJacob
|   | `- Re: bat file executionRalf Fassel
|   `* Re: bat file executionsaitology9
|    `* Re: bat file executionet99
|     +* Re: bat file executionet99
|     |`- Re: bat file executionJacob
|     `* Re: bat file executionsaitology9
|      `* Re: bat file executionet99
|       `* Re: bat file executionet99
|        +- Re: bat file executionHarald Oehlmann
|        `* Re: bat file executionRich
|         `* Re: bat file executionet99
|          `* Re: bat file executionHarald Oehlmann
|           `* Re: bat file executionet99
|            `* Re: bat file executionHarald Oehlmann
|             `* Re: bat file executionet99
|              `* Re: bat file executionHarald Oehlmann
|               `* Re: bat file executionet99
|                `* Re: bat file executionHarald Oehlmann
|                 `* Re: bat file executionet99
|                  `- Re: bat file executionet99
`* Re: bat file executiongreg
 `- Re: bat file executionet99

Pages:12
Re: bat file execution

<ur8cqa$31rl$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12988&group=comp.lang.tcl#12988

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 22 Feb 2024 13:03:06 -0800
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <ur8cqa$31rl$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 21:03:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="509dc670ebee3c5f14603374871ef51c";
logging-data="100213"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184M3OzRk31sFHu6j7KQdnh"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:6oUhLlANi1icgICa1yDvEH8l544=
In-Reply-To: <ur8c56$2tt8$1@dont-email.me>
Content-Language: en-US
 by: et99 - Thu, 22 Feb 2024 21:03 UTC

On 2/22/2024 12:51 PM, et99 wrote:
> On 2/22/2024 9:43 AM, saitology9 wrote:
>> On 2/22/2024 9:30 AM, Jacob wrote:
>>  >
>>  > Ralf,
>>  >
>>  > Sure, here is my bat file (test.bat):
>>  >
>>  > @echo off
>>  > (for %%a in (%*) do (
>>  >      echo %%a
>>  > ))
>>  >
>>  > I have placed the file in 2 locations:
>>  > "C:\batTest\bat test\test.bat"
>>  > "C:\batTest\test.bat"
>>  >
>>
>> Exec behavior may vary a bit depending on the platform, like using the right quotation to mark individual arguments to the command itself, but nevertheless this is interesting.
>>
>>
>> With a wish shell or from tkcon, there seems to be no way to properly escape an argument containing spaces, to the command being invoked, without breaking the exec command.
>>
>>
>> However, from a plain tclsh, everything works fine.  You can escape arguments with spaces by enclosing them in double-quotes, which Windows accepts fine.
>>
>>
>> # i added a line to the bat file
>> % exec $bat
>> done...
>>
>> % exec $bat 1 2 3
>> 1
>> 2
>> 3
>> done...
>>
>> % exec $bat 1 2 3 "Hello there"
>> 1
>> 2
>> 3
>> "Hello there"
>> done...
>>
>>
>>
>>
>
> I think some of these different results might also depend on the value of tcl_interactive.
>
> When it's set to 1, I can type (into a wish console):
>
> % start wish "C:/Users/et/Desktop/New folder/testargs.bat" one two "thr ee"
>
> and this works. But with exec it fails:
>
> % exec "C:/Users/et/Desktop/New folder/testargs.bat" one two "thr ee"
> 'C:\Users\et\Desktop\New' is not recognized as an internal or external command,
> operable program or batch file.
>
> but if "thr ee" is "three" it again works.
>
> I searched the tcl source and that message is nowhere to be found, I'm pretty certain it comes from windows, perhaps from some kind of error code to text windows call.
>
> I think a ticket is in order.
>

Oops, this might be working for me because my batch scripts can be executed either by windows batch, or by running with wish. Sometimes I outsmart myself :)

Re: bat file execution

<be61dc66-dd69-456f-9945-5974e4e832e7@clevelandgolf.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12989&group=comp.lang.tcl#12989

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: JacobLam...@clevelandgolf.com (Jacob)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 22 Feb 2024 13:36:44 -0800
Organization: A noiseless patient Spider
Lines: 86
Message-ID: <be61dc66-dd69-456f-9945-5974e4e832e7@clevelandgolf.com>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8cqa$31rl$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="779d1d705ef4f1877e4650f73ad7f933";
logging-data="115137"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/p72HpEfWAfqst1Kekm0vNP9G5/EyCb1s="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AbSTSUbc13nq+rczgBQAUNvzBvY=
Content-Language: en-US
In-Reply-To: <ur8cqa$31rl$1@dont-email.me>
 by: Jacob - Thu, 22 Feb 2024 21:36 UTC

On 2/22/2024 1:03 PM, et99 wrote:
> On 2/22/2024 12:51 PM, et99 wrote:
>> On 2/22/2024 9:43 AM, saitology9 wrote:
>>> On 2/22/2024 9:30 AM, Jacob wrote:
>>>  >
>>>  > Ralf,
>>>  >
>>>  > Sure, here is my bat file (test.bat):
>>>  >
>>>  > @echo off
>>>  > (for %%a in (%*) do (
>>>  >      echo %%a
>>>  > ))
>>>  >
>>>  > I have placed the file in 2 locations:
>>>  > "C:\batTest\bat test\test.bat"
>>>  > "C:\batTest\test.bat"
>>>  >
>>>
>>> Exec behavior may vary a bit depending on the platform, like using
>>> the right quotation to mark individual arguments to the command
>>> itself, but nevertheless this is interesting.
>>>
>>>
>>> With a wish shell or from tkcon, there seems to be no way to properly
>>> escape an argument containing spaces, to the command being invoked,
>>> without breaking the exec command.
>>>
>>>
>>> However, from a plain tclsh, everything works fine.  You can escape
>>> arguments with spaces by enclosing them in double-quotes, which
>>> Windows accepts fine.
>>>
>>>
>>> # i added a line to the bat file
>>> % exec $bat
>>> done...
>>>
>>> % exec $bat 1 2 3
>>> 1
>>> 2
>>> 3
>>> done...
>>>
>>> % exec $bat 1 2 3 "Hello there"
>>> 1
>>> 2
>>> 3
>>> "Hello there"
>>> done...
>>>
>>>
>>>
>>>
>>
>> I think some of these different results might also depend on the value
>> of tcl_interactive.
>>
>> When it's set to 1, I can type (into a wish console):
>>
>> % start wish "C:/Users/et/Desktop/New folder/testargs.bat" one two
>> "thr ee"
>>
>> and this works. But with exec it fails:
>>
>> % exec "C:/Users/et/Desktop/New folder/testargs.bat" one two "thr ee"
>> 'C:\Users\et\Desktop\New' is not recognized as an internal or external
>> command,
>> operable program or batch file.
>>
>> but if "thr ee" is "three" it again works.
>>
>> I searched the tcl source and that message is nowhere to be found, I'm
>> pretty certain it comes from windows, perhaps from some kind of error
>> code to text windows call.
>>
>> I think a ticket is in order.
>>
>
>
> Oops, this might be working for me because my batch scripts can be
> executed either by windows batch, or by running with wish. Sometimes I
> outsmart myself :)
>

Appreciate the help. I have submitted a ticket.

Re: bat file execution

<ur8tfv$6caf$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12990&group=comp.lang.tcl#12990

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 22 Feb 2024 20:47:42 -0500
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <ur8tfv$6caf$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 23 Feb 2024 01:47:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2c50e1d32e09d6e91f3d25268c1f9959";
logging-data="209231"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fxiM5Win9y0/raN0xGrIu"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ZsYoJnY5yBMR4yCGlUAFURHuPZQ=
In-Reply-To: <ur8c56$2tt8$1@dont-email.me>
Content-Language: en-US
 by: saitology9 - Fri, 23 Feb 2024 01:47 UTC

On 2/22/2024 3:51 PM, et99 wrote:
> On 2/22/2024 9:43 AM, saitology9 wrote:
>
> I think some of these different results might also depend on the value
> of tcl_interactive.
>

I would suspect that the error is most likely in wish's command line /
argument parsing code. It seems to be different from tclsh's version.
Tkcon is a red herring here because it relies on wish, so any behavioral
difference stemming from wish will also show up in tkcon.

Re: bat file execution

<ur95tq$bije$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12991&group=comp.lang.tcl#12991

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 22 Feb 2024 20:11:38 -0800
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <ur95tq$bije$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 04:11:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a2a2cc4076fc5f1586675b8b54d5cc59";
logging-data="379502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yXjwICaJq0UwjiZlT3xZM"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:myBceMm6HE6nIr5CUUIGK+vDxh4=
In-Reply-To: <ur8tfv$6caf$1@dont-email.me>
Content-Language: en-US
 by: et99 - Fri, 23 Feb 2024 04:11 UTC

On 2/22/2024 5:47 PM, saitology9 wrote:
> On 2/22/2024 3:51 PM, et99 wrote:
>> On 2/22/2024 9:43 AM, saitology9 wrote:
>>
>> I think some of these different results might also depend on the value of tcl_interactive.
>>
>
> I would suspect that the error is most likely in wish's command line / argument parsing code.  It seems to be different from tclsh's version. Tkcon is a red herring here because it relies on wish, so any behavioral difference stemming from wish will also show up in tkcon.
>
>
>

I took a look at the source code and it seems the key is the functions ApplicationType and then BuildCommandLine in tclWinPipe.c.

These two are called by TclpCreateProcess which has as input effectively a tcl arglist, which comes in as argv, and argv[0] is immediately sent to ApplicationType which returns a value, such as APPL_DOS (for .bat files).

This also converts argv[0] into a full complete path to the executable. In doing this conversion it does some directory searching where it tries the name as is, or then adds .com, .exe, .bat and .cmd in that order trying for a match.

If it is type APPL_DOS for .bat, then the command line is prefixed with the literal string "cmd.exe /c". The command line is built up into cmdLine.

Next, they call BuildCommandLine(execPath, argc, argv, &cmdLine) and this function looks at each arg and handles any escaping and quoting. There's much there I cannot easily follow, other than they continue to build up cmdLine. But it is pretty clear that this is where they should be enclosing the batch file in quotes.

This arg loop treats argv[0] separately, getting it from execPath instead, skipping over the original argv[0], having that been full-path'd, by ApplicationType. So, this arg either starts the command line, or is appended to "cmd.exe /c " and continues to build up cmdLine.

Finally, the actual windows call:

CreateProcessW(NULL, (WCHAR *) Tcl_DStringValue(&cmdLine),...

If I were to try to debug this, I likely would try inserting some printf's there since cmdLine is a regular C string. On linux, I used to simply do an fprintf(stderr,...) and it would output to a terminal windows. I can build tcl9.01 for windows but I don't know how to output debug stuff when the tk console is used. It might work in tclsh, but that isn't where the problem seems to be.

Maybe someone else might want to play with this some more, I'm getting sleepy :)

Re: bat file execution

<ur9frb$ddu2$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12992&group=comp.lang.tcl#12992

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 22 Feb 2024 23:00:57 -0800
Organization: A noiseless patient Spider
Lines: 103
Message-ID: <ur9frb$ddu2$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 07:00:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a2a2cc4076fc5f1586675b8b54d5cc59";
logging-data="440258"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1UCvcRt21pRkRCVAOhOFE"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:vTA7cX1kUqExUUP9rfgp+x3psxE=
In-Reply-To: <ur95tq$bije$1@dont-email.me>
Content-Language: en-US
 by: et99 - Fri, 23 Feb 2024 07:00 UTC

On 2/22/2024 8:11 PM, et99 wrote:
> On 2/22/2024 5:47 PM, saitology9 wrote:
>> On 2/22/2024 3:51 PM, et99 wrote:
>>> On 2/22/2024 9:43 AM, saitology9 wrote:
>>>
>>> I think some of these different results might also depend on the value of tcl_interactive.
>>>
>>
>> I would suspect that the error is most likely in wish's command line / argument parsing code.  It seems to be different from tclsh's version. Tkcon is a red herring here because it relies on wish, so any behavioral difference stemming from wish will also show up in tkcon.
>>
>>
>>
>
> I took a look at the source code and it seems the key is the functions ApplicationType and then BuildCommandLine in tclWinPipe.c.
>
> These two are called by TclpCreateProcess which has as input effectively a tcl arglist, which comes in as argv, and argv[0] is immediately sent to ApplicationType which returns a value, such as APPL_DOS (for .bat files).
>
> This also converts argv[0] into a full complete path to the executable. In doing this conversion it does some directory searching where it tries the name as is, or then adds .com, .exe, .bat and .cmd in that order trying for a match.
>
> If it is type APPL_DOS for .bat, then the command line is prefixed with the literal string "cmd.exe /c". The command line is built up into cmdLine.
>
> Next, they call BuildCommandLine(execPath, argc, argv, &cmdLine) and this function looks at each arg and handles any escaping and quoting. There's much there I cannot easily follow, other than they continue to build up cmdLine. But it is pretty clear that this is where they should be enclosing the batch file in quotes.
>
> This arg loop treats argv[0] separately, getting it from execPath instead, skipping over the original argv[0], having that been full-path'd, by ApplicationType. So, this arg either starts the command line, or is appended to "cmd.exe /c " and continues to build up cmdLine.
>
> Finally, the actual windows call:
>
> CreateProcessW(NULL, (WCHAR *) Tcl_DStringValue(&cmdLine),...
>
> If I were to try to debug this, I likely would try inserting some printf's there since cmdLine is a regular C string. On linux, I used to simply do an fprintf(stderr,...) and it would output to a terminal windows. I can build tcl9.01 for windows but I don't know how to output debug stuff when the tk console is used. It might work in tclsh, but that isn't where the problem seems to be.
>
> Maybe someone else might want to play with this some more, I'm getting sleepy :)
>
>
>
>

Well, back at it. ... but I think (99.9% sure) I know the problem.

When it's a batch job, i.e. something .bat, wish generates:

cmd.exe /c "pa th\to.bat" "pa th/to.txt" 8

and that fails. If you enter that into a windows cmd window, it also fails *because* it needs to have another set of quotes around the whole string following the /c.

Changing that in a cmd window to:

cmd.exe /c ""pa th\to.bat" "pa th/to.txt" 8"

and it works.

When the path to the batch file has no spaces, it does not quote that, *and* will fail if you do add quotes anyway. Now that's really weird, but in fact I saw something about that in the documentation.

Now, if you use tclsh and exec, it ends up being just this:

"pa th\to.bat" "pa th/to.txt" 8

and that works from tclsh and also in a cmd window.

It's because the call to HasConsole() returns true in tclsh so that the command line is not prefixed with cmd.exe /c

BTW, the cmdLine variable is actually a 16 unicode string and I had to convert it so I could log it to a file.

Here's the key code:

if (HasConsole()) {
createFlags = 0;
} else if (applType == APPL_DOS) {
/*
* Under NT, 16-bit DOS applications will not run unless they can
* be attached to a console. If we are running without a console,
* run the 16-bit program as an normal process inside of a hidden
* console application, and then run that hidden console as a
* detached process.
*/

startInfo.wShowWindow = SW_HIDE;
startInfo.dwFlags |= STARTF_USESHOWWINDOW;
createFlags = CREATE_NEW_CONSOLE;
TclDStringAppendLiteral(&cmdLine, "cmd.exe /c");
} else {
createFlags = DETACHED_PROCESS;

}

Re: bat file execution

<ur9oha$f5rr$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12993&group=comp.lang.tcl#12993

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Fri, 23 Feb 2024 10:29:14 +0100
Organization: A noiseless patient Spider
Lines: 135
Message-ID: <ur9oha$f5rr$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 09:29:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2839d56683fe88597a7ea4c84a6e09b3";
logging-data="497531"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zinoIE4f8qG3LhtGNq+i+"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:z+BCD46qBM/RTdNuwwfzZBcOftY=
Content-Language: en-GB
In-Reply-To: <ur9frb$ddu2$1@dont-email.me>
 by: Harald Oehlmann - Fri, 23 Feb 2024 09:29 UTC

Am 23.02.2024 um 08:00 schrieb et99:
> On 2/22/2024 8:11 PM, et99 wrote:
>> On 2/22/2024 5:47 PM, saitology9 wrote:
>>> On 2/22/2024 3:51 PM, et99 wrote:
>>>> On 2/22/2024 9:43 AM, saitology9 wrote:
>>>>
>>>> I think some of these different results might also depend on the
>>>> value of tcl_interactive.
>>>>
>>>
>>> I would suspect that the error is most likely in wish's command line
>>> / argument parsing code.  It seems to be different from tclsh's
>>> version. Tkcon is a red herring here because it relies on wish, so
>>> any behavioral difference stemming from wish will also show up in tkcon.
>>>
>>>
>>>
>>
>> I took a look at the source code and it seems the key is the functions
>> ApplicationType and then BuildCommandLine in tclWinPipe.c.
>>
>> These two are called by TclpCreateProcess which has as input
>> effectively a tcl arglist, which comes in as argv, and argv[0] is
>> immediately sent to ApplicationType which returns a value, such as
>> APPL_DOS (for .bat files).
>>
>> This also converts argv[0] into a full complete path to the
>> executable. In doing this conversion it does some directory searching
>> where it tries the name as is, or then adds .com, .exe, .bat and .cmd
>> in that order trying for a match.
>>
>> If it is type APPL_DOS for .bat, then the command line is prefixed
>> with the literal string "cmd.exe /c". The command line is built up
>> into cmdLine.
>>
>> Next, they call BuildCommandLine(execPath, argc, argv, &cmdLine) and
>> this function looks at each arg and handles any escaping and quoting.
>> There's much there I cannot easily follow, other than they continue to
>> build up cmdLine. But it is pretty clear that this is where they
>> should be enclosing the batch file in quotes.
>>
>> This arg loop treats argv[0] separately, getting it from execPath
>> instead, skipping over the original argv[0], having that been
>> full-path'd, by ApplicationType. So, this arg either starts the
>> command line, or is appended to "cmd.exe /c " and continues to build
>> up cmdLine.
>>
>> Finally, the actual windows call:
>>
>> CreateProcessW(NULL, (WCHAR *) Tcl_DStringValue(&cmdLine),...
>>
>> If I were to try to debug this, I likely would try inserting some
>> printf's there since cmdLine is a regular C string. On linux, I used
>> to simply do an fprintf(stderr,...) and it would output to a terminal
>> windows. I can build tcl9.01 for windows but I don't know how to
>> output debug stuff when the tk console is used. It might work in
>> tclsh, but that isn't where the problem seems to be.
>>
>> Maybe someone else might want to play with this some more, I'm getting
>> sleepy :)
>>
>>
>>
>>
>
>
> Well, back at it. ... but I think (99.9% sure) I know the problem.
>
>
>
> When it's a batch job, i.e. something .bat, wish generates:
>
>    cmd.exe /c "pa th\to.bat" "pa th/to.txt" 8
>
> and that fails. If you enter that into a windows cmd window, it also
> fails *because* it needs to have another set of quotes around the whole
> string following the /c.
>
>
> Changing that in a cmd window to:
>
>    cmd.exe /c ""pa th\to.bat" "pa th/to.txt" 8"
>
> and it works.
>
> When the path to the batch file has no spaces, it does not quote that,
> *and* will fail if you do add quotes anyway. Now that's really weird,
> but in fact I saw something about that in the documentation.
>
>
>
> Now, if you use tclsh and exec, it ends up being just this:
>
>    "pa th\to.bat" "pa th/to.txt" 8
>
> and that works from tclsh and also in a cmd window.
>
> It's because the call to HasConsole() returns true in tclsh so that the
> command line is not prefixed with cmd.exe /c
>
> BTW, the cmdLine variable is actually a 16 unicode string and I had to
> convert it so I could log it to a file.
>
>
>
>
>
>
> Here's the key code:
>
>     if (HasConsole()) {
>         createFlags = 0;
>     } else if (applType == APPL_DOS) {
>     /*
>      * Under NT, 16-bit DOS applications will not run unless they can
>      * be attached to a console. If we are running without a console,
>      * run the 16-bit program as an normal process inside of a hidden
>      * console application, and then run that hidden console as a
>      * detached process.
>      */
>
>       startInfo.wShowWindow = SW_HIDE;
>       startInfo.dwFlags |= STARTF_USESHOWWINDOW;
>       createFlags = CREATE_NEW_CONSOLE;
>       TclDStringAppendLiteral(&cmdLine, "cmd.exe /c");
>     } else {
>        createFlags = DETACHED_PROCESS;
>     }

I saw the bug analysis-great. It might be a tk bug, as wish is only
present with tk.

Take care,
Harald

Re: bat file execution

<uraojv$mcmg$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12996&group=comp.lang.tcl#12996

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Fri, 23 Feb 2024 18:36:47 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uraojv$mcmg$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me> <ygaa5ntn48p.fsf@panther.akutech-local.de> <e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com> <yga5xygn6lb.fsf@panther.akutech-local.de> <f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com> <ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me> <ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me> <ur9frb$ddu2$1@dont-email.me>
Injection-Date: Fri, 23 Feb 2024 18:36:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2de42414af06e7ded03db8694194233b";
logging-data="733904"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ouLTfzkkbv/2dCJYPlrgV"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:aLQqkVEi8BnrUWEca6gXtuWLlfc=
 by: Rich - Fri, 23 Feb 2024 18:36 UTC

et99 <et99@rocketship1.me> wrote:
> BTW, the cmdLine variable is actually a 16 unicode string and I had
> to convert it so I could log it to a file.

I think you mean a UTF-16 string. That is the native encoding used by
the NT kernel underlying modern MS windows. When NT was being
developed, UTF-16 was seen as the "be all" encoding. UTF-8
subsequently won out in the end, but NT now has to carry the UTF-16
legacy baggage around.

Re: bat file execution

<urb66a$pega$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12998&group=comp.lang.tcl#12998

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Fri, 23 Feb 2024 14:28:25 -0800
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <urb66a$pega$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 23 Feb 2024 22:28:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a2a2cc4076fc5f1586675b8b54d5cc59";
logging-data="834058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ElITjYSe+v03s1/6YwPzm"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:3j+j91fVDBF7/3fkf005mGp0JqQ=
Content-Language: en-US
In-Reply-To: <uraojv$mcmg$1@dont-email.me>
 by: et99 - Fri, 23 Feb 2024 22:28 UTC

Harald wrote:

>It might be a tk bug, as wish is only present with tk.

It's code that is found in the windows specific code for [exec] in tclWinPipe.c, which is called by both tclsh and wish. The difference being that the hasconsole() function returns different values for wish and tclsh. The reason it fails with .bat files is the function ApplicationType returns APPL_DOS because of the file extension:

if ((ext != NULL) &&
(strcasecmp(ext, ".cmd") == 0 || strcasecmp(ext, ".bat") == 0)) {
applType = APPL_DOS;
break;
}

And then after it gets a fasle from hasconsole(), it tests for APPL_DOS, and adds the "cmd.exe /c" but doesn't do the quoting right.

This also explains why it doesn't fail with .exe with non-legacy executables. The code actually reads the header's of the files, looking for some really old "magic numbers" as it calls them to return some other application types for .exe, but really old executables can still result in APPL_DOS.

I've added my analysis to the bug report.

On 2/23/2024 10:36 AM, Rich wrote:
> et99 <et99@rocketship1.me> wrote:
>> BTW, the cmdLine variable is actually a 16 unicode string and I had
>> to convert it so I could log it to a file.
>
> I think you mean a UTF-16 string. That is the native encoding used by
> the NT kernel underlying modern MS windows. When NT was being
> developed, UTF-16 was seen as the "be all" encoding. UTF-8
> subsequently won out in the end, but NT now has to carry the UTF-16
> legacy baggage around.
>

Yes, you're right. At first I was only getting the first char C in my logger. That's when I guessed it was 16 bit, with every other byte a 0, and confirmed that the windows commandline argument was indeed unicode.

Here's my log code, in case anyone else might find it useful for debugging on windows:

I placed this at the top of the file (a: is my temp ramdisk):

/* -------------- debugging printf to a log file ---------------- */
#include <stdarg.h>
#include <stdlib.h>

void
bugprintf (const char *template, ...)
{ va_list ap;

FILE *io;
io = fopen("a:/log.txt","a");
va_start (ap, template);
vfprintf (io, template, ap);
va_end (ap);
fclose(io);

} char bug_buffer[1000]; /* for unicode to plain ascii conversion */

Then just before it calls the windows CreateProcessW code:

wcstombs(bug_buffer, (WCHAR *) Tcl_DStringValue(&cmdLine), 999);
bugprintf("pathb = |%s|\n",bug_buffer);

This is apparently enough, as the output was null terminated.

Re: bat file execution

<urhjrj$2eoke$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13002&group=comp.lang.tcl#13002

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Mon, 26 Feb 2024 09:58:27 +0100
Organization: A noiseless patient Spider
Lines: 95
Message-ID: <urhjrj$2eoke$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 26 Feb 2024 08:58:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ce8b64f94f09f047a293dc395840d90a";
logging-data="2581134"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/b829iJhX6VxqAYOONMn79"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rrs4XsVx9CPWqxqLoYMbrilwB5U=
In-Reply-To: <urb66a$pega$1@dont-email.me>
Content-Language: en-GB
 by: Harald Oehlmann - Mon, 26 Feb 2024 08:58 UTC

Hi ET99,

great analysis, thank you.

Unfortunately, I can not see new information in the ticket:

https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d

Or do you mean your post 2024-02-23 07:34:22 ?

Take care,
Harald

Am 23.02.2024 um 23:28 schrieb et99:
> Harald wrote:
>
>> It might be a tk bug, as wish is only present with tk.
>
> It's code that is found in the windows specific code for [exec] in
> tclWinPipe.c, which is called by both tclsh and wish. The difference
> being that the hasconsole() function returns different values for wish
> and tclsh. The reason it fails with .bat files is the function
> ApplicationType returns APPL_DOS because of the file extension:
>
>
>     if ((ext != NULL) &&
>             (strcasecmp(ext, ".cmd") == 0 || strcasecmp(ext, ".bat") ==
> 0)) {
>         applType = APPL_DOS;
>         break;
>     }
>
> And then after it gets a fasle from hasconsole(), it tests for APPL_DOS,
> and adds the "cmd.exe /c" but doesn't do the quoting right.
>
> This also explains why it doesn't fail with .exe with non-legacy
> executables. The code actually reads the header's of the files, looking
> for some really old "magic numbers" as it calls them to return some
> other application types for .exe, but really old executables can still
> result in APPL_DOS.
>
>
> I've added my analysis to the bug report.
>
>
> On 2/23/2024 10:36 AM, Rich wrote:
>> et99 <et99@rocketship1.me> wrote:
>>> BTW, the cmdLine variable is actually a 16 unicode string and I had
>>> to convert it so I could log it to a file.
>>
>> I think you mean a UTF-16 string.  That is the native encoding used by
>> the NT kernel underlying modern MS windows.  When NT was being
>> developed, UTF-16 was seen as the "be all" encoding.  UTF-8
>> subsequently won out in the end, but NT now has to carry the UTF-16
>> legacy baggage around.
>>
>
> Yes, you're right. At first I was only getting the first char C in my
> logger. That's when I guessed it was 16 bit, with every other byte a 0,
> and confirmed that the windows commandline argument was indeed unicode.
>
> Here's my log code, in case anyone else might find it useful for
> debugging on windows:
>
>
> I placed this at the top of the file (a: is my temp ramdisk):
>
> /* -------------- debugging printf to a log file ---------------- */
> #include <stdarg.h>
> #include <stdlib.h>
>
> void
> bugprintf (const char *template, ...)
> {
>   va_list ap;
>   FILE *io;
>   io = fopen("a:/log.txt","a");
>   va_start (ap, template);
>   vfprintf (io, template, ap);
>   va_end (ap);
>   fclose(io);
> }
> char bug_buffer[1000]; /* for unicode to plain ascii conversion */
>
>
> Then just before it calls the windows CreateProcessW code:
>
>     wcstombs(bug_buffer, (WCHAR *) Tcl_DStringValue(&cmdLine), 999);
>     bugprintf("pathb = |%s|\n",bug_buffer);
>
> This is apparently enough, as the output was null terminated.
>
>

Re: bat file execution

<urlvt7$3g7og$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13007&group=comp.lang.tcl#13007

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Tue, 27 Feb 2024 16:48:37 -0800
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <urlvt7$3g7og$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me> <urhjrj$2eoke$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Feb 2024 00:48:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1cf2c32a2a079921d7c037ea6b0c8503";
logging-data="3677968"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199UTMICUZQYqhyfubAJjAM"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:QmE6K4KjZ/tFrDHiLT8jnileP7Q=
Content-Language: en-US
In-Reply-To: <urhjrj$2eoke$1@dont-email.me>
 by: et99 - Wed, 28 Feb 2024 00:48 UTC

On 2/26/2024 12:58 AM, Harald Oehlmann wrote:
> Hi ET99,
>
> great analysis, thank you.
>
> Unfortunately, I can not see new information in the ticket:
>
> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>
> Or do you mean your post 2024-02-23 07:34:22 ?
>
> Take care,
> Harald
>
>

Yes, that was what I added to the ticket.

I probably should have mentioned that my tests, and the code I was referencing was from 9.0b1, since I just now compared tclWinPipe.c from 8.6.13 to 9.0b1 and there is a bit of difference. It hadn't occurred to me that the code would be different with respect to cmd.exe /c. It appears that in 8.6.13 there's a test that is removed in 9.0b1:

if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {

And that is what oehhar mentions in the ticket. I can say with confidence that the 9.0b1 code has the problem, and perhaps because that was removed.

I didn't hand build and trace 8.6.13, so that might be doing something different. There I was using magicsplat 8.6.13, but also a tclkit 8.6.9 and this might also explain why some of the failures I got were different than what Jacob was seeing.

Sorry for any confusion I might have caused. I just sent a clarification to the ticket.

Re: bat file execution

<urmq9t$3ohci$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13009&group=comp.lang.tcl#13009

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Wed, 28 Feb 2024 09:19:09 +0100
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <urmq9t$3ohci$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me> <urhjrj$2eoke$1@dont-email.me>
<urlvt7$3g7og$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Feb 2024 08:19:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="75088c361c1919e3a5ff940ba499003a";
logging-data="3949970"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/iiyBzwqODGDVww3HgfiK"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vl4ZoEMiKiE8rre5tkG/826mQ5w=
In-Reply-To: <urlvt7$3g7og$1@dont-email.me>
Content-Language: en-GB
 by: Harald Oehlmann - Wed, 28 Feb 2024 08:19 UTC

Am 28.02.2024 um 01:48 schrieb et99:
> On 2/26/2024 12:58 AM, Harald Oehlmann wrote:
>> Hi ET99,
>>
>> great analysis, thank you.
>>
>> Unfortunately, I can not see new information in the ticket:
>>
>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>
>> Or do you mean your post 2024-02-23 07:34:22 ?
>>
>> Take care,
>> Harald
>>
>>
>
> Yes, that was what I added to the ticket.
>
> I probably should have mentioned that my tests, and the code I was
> referencing was from 9.0b1, since I just now compared tclWinPipe.c from
> 8.6.13 to 9.0b1 and there is a bit of difference. It hadn't occurred to
> me that the code would be different with respect to cmd.exe /c. It
> appears that in 8.6.13 there's a test that is removed in 9.0b1:
>
>     if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
>
> And that is what oehhar mentions in the ticket. I can say with
> confidence that the 9.0b1 code has the problem, and perhaps because that
> was removed.
>
> I didn't hand build and trace 8.6.13, so that might be doing something
> different. There I was using magicsplat 8.6.13, but also a tclkit 8.6.9
> and this might also explain why some of the failures I got were
> different than what Jacob was seeing.
>
>
> Sorry for any confusion I might have caused. I just sent a clarification
> to the ticket.
>
>
>
>
>

Hi ET99,
no, there is no confusion, no problem. Only confusing code ;-).

It would be great if you could test the two proposed bug branches, if
they work for you or not.

Take care,
Harald

Re: bat file execution

<uro1bt$1o57$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13013&group=comp.lang.tcl#13013

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Wed, 28 Feb 2024 11:25:49 -0800
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <uro1bt$1o57$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me> <urhjrj$2eoke$1@dont-email.me>
<urlvt7$3g7og$1@dont-email.me> <urmq9t$3ohci$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Feb 2024 19:25:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1cf2c32a2a079921d7c037ea6b0c8503";
logging-data="57511"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18syfqai2u1/2Yl89ecEwEe"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:z0JLDKJTfzJADRCXs4Kjv+KOjqY=
In-Reply-To: <urmq9t$3ohci$1@dont-email.me>
Content-Language: en-US
 by: et99 - Wed, 28 Feb 2024 19:25 UTC

On 2/28/2024 12:19 AM, Harald Oehlmann wrote:
> Am 28.02.2024 um 01:48 schrieb et99:
>> On 2/26/2024 12:58 AM, Harald Oehlmann wrote:
>>> Hi ET99,
>>>
>>> great analysis, thank you.
>>>
>>> Unfortunately, I can not see new information in the ticket:
>>>
>>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>>
>>> Or do you mean your post 2024-02-23 07:34:22 ?
>>>
>>> Take care,
>>> Harald
>>>
>>>
>>
>> Yes, that was what I added to the ticket.
>>
>> I probably should have mentioned that my tests, and the code I was referencing was from 9.0b1, since I just now compared tclWinPipe.c from 8.6.13 to 9.0b1 and there is a bit of difference. It hadn't occurred to me that the code would be different with respect to cmd.exe /c. It appears that in 8.6.13 there's a test that is removed in 9.0b1:
>>
>>      if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
>>
>> And that is what oehhar mentions in the ticket. I can say with confidence that the 9.0b1 code has the problem, and perhaps because that was removed.
>>
>> I didn't hand build and trace 8.6.13, so that might be doing something different. There I was using magicsplat 8.6.13, but also a tclkit 8.6.9 and this might also explain why some of the failures I got were different than what Jacob was seeing.
>>
>>
>> Sorry for any confusion I might have caused. I just sent a clarification to the ticket.
>>
>>
>>
>>
>>
>
> Hi ET99,
> no, there is no confusion, no problem. Only confusing code ;-).
>
> It would be great if you could test the two proposed bug branches, if they work for you or not.
>
> Take care,
> Harald

I could do that but I would need to know how to get the new code. I only just learned how to build from sources on windows. I don't know how the code management system works. If you could copy out the entire file somewhere with a link, or post it somewhere on the wiki, I could grab it and do a build. It's win/tclWinPipe.c, correct? I do have a pretty good program for comparing files (beyond compare) so I could see what's different.

-et

Re: bat file execution

<uro28u$223t$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13014&group=comp.lang.tcl#13014

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Wed, 28 Feb 2024 20:41:18 +0100
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <uro28u$223t$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me> <urhjrj$2eoke$1@dont-email.me>
<urlvt7$3g7og$1@dont-email.me> <urmq9t$3ohci$1@dont-email.me>
<uro1bt$1o57$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Feb 2024 19:41:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="75088c361c1919e3a5ff940ba499003a";
logging-data="67709"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xpHpds1rszVIfqwWJDS4q"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:p0F0Es78Nl6j4OwTTWHr31s4/Io=
Content-Language: en-GB
In-Reply-To: <uro1bt$1o57$1@dont-email.me>
 by: Harald Oehlmann - Wed, 28 Feb 2024 19:41 UTC

Am 28.02.2024 um 20:25 schrieb et99:
> On 2/28/2024 12:19 AM, Harald Oehlmann wrote:
>> Am 28.02.2024 um 01:48 schrieb et99:
>>> On 2/26/2024 12:58 AM, Harald Oehlmann wrote:
>>>> Hi ET99,
>>>>
>>>> great analysis, thank you.
>>>>
>>>> Unfortunately, I can not see new information in the ticket:
>>>>
>>>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>>>
>>>> Or do you mean your post 2024-02-23 07:34:22 ?
>>>>
>>>> Take care,
>>>> Harald
>>>>
>>>>
>>>
>>> Yes, that was what I added to the ticket.
>>>
>>> I probably should have mentioned that my tests, and the code I was
>>> referencing was from 9.0b1, since I just now compared tclWinPipe.c
>>> from 8.6.13 to 9.0b1 and there is a bit of difference. It hadn't
>>> occurred to me that the code would be different with respect to
>>> cmd.exe /c. It appears that in 8.6.13 there's a test that is removed
>>> in 9.0b1:
>>>
>>>      if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
>>>
>>> And that is what oehhar mentions in the ticket. I can say with
>>> confidence that the 9.0b1 code has the problem, and perhaps because
>>> that was removed.
>>>
>>> I didn't hand build and trace 8.6.13, so that might be doing
>>> something different. There I was using magicsplat 8.6.13, but also a
>>> tclkit 8.6.9 and this might also explain why some of the failures I
>>> got were different than what Jacob was seeing.
>>>
>>>
>>> Sorry for any confusion I might have caused. I just sent a
>>> clarification to the ticket.
>>>
>>>
>>>
>>>
>>>
>>
>> Hi ET99,
>> no, there is no confusion, no problem. Only confusing code ;-).
>>
>> It would be great if you could test the two proposed bug branches, if
>> they work for you or not.
>>
>> Take care,
>> Harald
>
>
> I could do that but I would need to know how to get the new code. I only
> just learned how to build from sources on windows. I don't know how the
> code management system works. If you could copy out the entire file
> somewhere with a link, or post it somewhere on the wiki, I could grab it
> and do a build. It's win/tclWinPipe.c, correct? I do have a pretty good
> program for comparing files (beyond compare) so I could see what's
> different.
>
> -et
>

Yes, no problem.

Go to:
https://core.tcl-lang.org/tcl/login
and log in as anonymous with the ASCII-Art password.
Then find the two proposed branches.
You may use the timeline and find the two red colored lines
https://core.tcl-lang.org/tcl/timeline
or you go to the ticket:
https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
within the 3rd comment titled:
oehhar added on 2024-02-26 14:09:08:
you find 2 blue links.
If you press on the links, the chckin page opens.
You see the proposed changes as a diff.
To download, look to the 2nd line from the top titled "Downloads".
I would click on "ZIP archive" to download the whole distribution.

Please come back to me in case of any questions.

Thank you and take care,
Harald

Re: bat file execution

<urpjdo$f0ar$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13017&group=comp.lang.tcl#13017

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 29 Feb 2024 01:40:06 -0800
Organization: A noiseless patient Spider
Lines: 80
Message-ID: <urpjdo$f0ar$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me> <urhjrj$2eoke$1@dont-email.me>
<urlvt7$3g7og$1@dont-email.me> <urmq9t$3ohci$1@dont-email.me>
<uro1bt$1o57$1@dont-email.me> <uro28u$223t$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Feb 2024 09:40:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2ed15998e892d66997fe34353e8a897";
logging-data="491867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+K+Bsq1va3+W4OMRyPUOA1"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:aKTATNER2dbxiOx0Sqt+ay10xN4=
Content-Language: en-US
In-Reply-To: <uro28u$223t$1@dont-email.me>
 by: et99 - Thu, 29 Feb 2024 09:40 UTC

On 2/28/2024 11:41 AM, Harald Oehlmann wrote:
> Am 28.02.2024 um 20:25 schrieb et99:
>> On 2/28/2024 12:19 AM, Harald Oehlmann wrote:
>>> Am 28.02.2024 um 01:48 schrieb et99:
>>>> On 2/26/2024 12:58 AM, Harald Oehlmann wrote:
>>>>> Hi ET99,
>>>>>
>>>>> great analysis, thank you.
>>>>>
>>>>> Unfortunately, I can not see new information in the ticket:
>>>>>
>>>>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>>>>
>>>>> Or do you mean your post 2024-02-23 07:34:22 ?
>>>>>
>>>>> Take care,
>>>>> Harald
>>>>>
>>>>>
>>>>
>>>> Yes, that was what I added to the ticket.
>>>>
>>>> I probably should have mentioned that my tests, and the code I was referencing was from 9.0b1, since I just now compared tclWinPipe.c from 8.6.13 to 9.0b1 and there is a bit of difference. It hadn't occurred to me that the code would be different with respect to cmd.exe /c. It appears that in 8.6.13 there's a test that is removed in 9.0b1:
>>>>
>>>>      if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
>>>>
>>>> And that is what oehhar mentions in the ticket. I can say with confidence that the 9.0b1 code has the problem, and perhaps because that was removed.
>>>>
>>>> I didn't hand build and trace 8.6.13, so that might be doing something different. There I was using magicsplat 8.6.13, but also a tclkit 8.6.9 and this might also explain why some of the failures I got were different than what Jacob was seeing.
>>>>
>>>>
>>>> Sorry for any confusion I might have caused. I just sent a clarification to the ticket.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> Hi ET99,
>>> no, there is no confusion, no problem. Only confusing code ;-).
>>>
>>> It would be great if you could test the two proposed bug branches, if they work for you or not.
>>>
>>> Take care,
>>> Harald
>>
>>
>> I could do that but I would need to know how to get the new code. I only just learned how to build from sources on windows. I don't know how the code management system works. If you could copy out the entire file somewhere with a link, or post it somewhere on the wiki, I could grab it and do a build. It's win/tclWinPipe.c, correct? I do have a pretty good program for comparing files (beyond compare) so I could see what's different.
>>
>> -et
>>
>
> Yes, no problem.
>
> Go to:
> https://core.tcl-lang.org/tcl/login
> and log in as anonymous with the ASCII-Art password.
> Then find the two proposed branches.
> You may use the timeline and find the two red colored lines
> https://core.tcl-lang.org/tcl/timeline
> or you go to the ticket:
> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
> within the 3rd comment titled:
> oehhar added on 2024-02-26 14:09:08:
> you find 2 blue links.
> If you press on the links, the chckin page opens.
> You see the proposed changes as a diff.
> To download, look to the 2nd line from the top titled "Downloads".
> I would click on "ZIP archive" to download the whole distribution.
>
> Please come back to me in case of any questions.
>
> Thank you and take care,
> Harald

I tried to find it but to no avail. I only am really in a position to build 9.0b1. When the next 9.0 beta comes out I can take a look, assuming the fix will go in there. Sorry.

Re: bat file execution

<urpkvu$fa6h$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13018&group=comp.lang.tcl#13018

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 29 Feb 2024 11:06:54 +0100
Organization: A noiseless patient Spider
Lines: 104
Message-ID: <urpkvu$fa6h$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me> <urhjrj$2eoke$1@dont-email.me>
<urlvt7$3g7og$1@dont-email.me> <urmq9t$3ohci$1@dont-email.me>
<uro1bt$1o57$1@dont-email.me> <uro28u$223t$1@dont-email.me>
<urpjdo$f0ar$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Feb 2024 10:06:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="efcc726f318126e8f2eba6262534e1c4";
logging-data="501969"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/UplH7WQ8Qxl3f0xQ1LRPX"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:QHpzhV+KIOp0uHagYxTn+2LOZmk=
In-Reply-To: <urpjdo$f0ar$1@dont-email.me>
Content-Language: en-GB
 by: Harald Oehlmann - Thu, 29 Feb 2024 10:06 UTC

Am 29.02.2024 um 10:40 schrieb et99:
> On 2/28/2024 11:41 AM, Harald Oehlmann wrote:
>> Am 28.02.2024 um 20:25 schrieb et99:
>>> On 2/28/2024 12:19 AM, Harald Oehlmann wrote:
>>>> Am 28.02.2024 um 01:48 schrieb et99:
>>>>> On 2/26/2024 12:58 AM, Harald Oehlmann wrote:
>>>>>> Hi ET99,
>>>>>>
>>>>>> great analysis, thank you.
>>>>>>
>>>>>> Unfortunately, I can not see new information in the ticket:
>>>>>>
>>>>>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>>>>>
>>>>>> Or do you mean your post 2024-02-23 07:34:22 ?
>>>>>>
>>>>>> Take care,
>>>>>> Harald
>>>>>>
>>>>>>
>>>>>
>>>>> Yes, that was what I added to the ticket.
>>>>>
>>>>> I probably should have mentioned that my tests, and the code I was
>>>>> referencing was from 9.0b1, since I just now compared tclWinPipe.c
>>>>> from 8.6.13 to 9.0b1 and there is a bit of difference. It hadn't
>>>>> occurred to me that the code would be different with respect to
>>>>> cmd.exe /c. It appears that in 8.6.13 there's a test that is
>>>>> removed in 9.0b1:
>>>>>
>>>>>      if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
>>>>>
>>>>> And that is what oehhar mentions in the ticket. I can say with
>>>>> confidence that the 9.0b1 code has the problem, and perhaps because
>>>>> that was removed.
>>>>>
>>>>> I didn't hand build and trace 8.6.13, so that might be doing
>>>>> something different. There I was using magicsplat 8.6.13, but also
>>>>> a tclkit 8.6.9 and this might also explain why some of the failures
>>>>> I got were different than what Jacob was seeing.
>>>>>
>>>>>
>>>>> Sorry for any confusion I might have caused. I just sent a
>>>>> clarification to the ticket.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> Hi ET99,
>>>> no, there is no confusion, no problem. Only confusing code ;-).
>>>>
>>>> It would be great if you could test the two proposed bug branches,
>>>> if they work for you or not.
>>>>
>>>> Take care,
>>>> Harald
>>>
>>>
>>> I could do that but I would need to know how to get the new code. I
>>> only just learned how to build from sources on windows. I don't know
>>> how the code management system works. If you could copy out the
>>> entire file somewhere with a link, or post it somewhere on the wiki,
>>> I could grab it and do a build. It's win/tclWinPipe.c, correct? I do
>>> have a pretty good program for comparing files (beyond compare) so I
>>> could see what's different.
>>>
>>> -et
>>>
>>
>> Yes, no problem.
>>
>> Go to:
>> https://core.tcl-lang.org/tcl/login
>> and log in as anonymous with the ASCII-Art password.
>> Then find the two proposed branches.
>> You may use the timeline and find the two red colored lines
>> https://core.tcl-lang.org/tcl/timeline
>> or you go to the ticket:
>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>> within the 3rd comment titled:
>> oehhar added on 2024-02-26 14:09:08:
>> you find 2 blue links.
>> If you press on the links, the chckin page opens.
>> You see the proposed changes as a diff.
>> To download, look to the 2nd line from the top titled "Downloads".
>> I would click on "ZIP archive" to download the whole distribution.
>>
>> Please come back to me in case of any questions.
>>
>> Thank you and take care,
>> Harald
>
> I tried to find it but to no avail.  I only am really in a position to
> build 9.0b1. When the next 9.0 beta comes out I can take a look,
> assuming the fix will go in there. Sorry.

No, sorry. The fix will go nowhere, as nobody cares.
I tried, I failed - end of the story....

Sorry,
Harald

Re: bat file execution

<urqnfl$pcrr$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13020&group=comp.lang.tcl#13020

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 29 Feb 2024 11:55:31 -0800
Organization: A noiseless patient Spider
Lines: 119
Message-ID: <urqnfl$pcrr$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me> <urhjrj$2eoke$1@dont-email.me>
<urlvt7$3g7og$1@dont-email.me> <urmq9t$3ohci$1@dont-email.me>
<uro1bt$1o57$1@dont-email.me> <uro28u$223t$1@dont-email.me>
<urpjdo$f0ar$1@dont-email.me> <urpkvu$fa6h$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Feb 2024 19:55:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2ed15998e892d66997fe34353e8a897";
logging-data="832379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+q9y9660lk8FUk7PZX+9Zm"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:mV44Es+n7aOZuF9MCJLcks+BhwE=
In-Reply-To: <urpkvu$fa6h$1@dont-email.me>
Content-Language: en-US
 by: et99 - Thu, 29 Feb 2024 19:55 UTC

On 2/29/2024 2:06 AM, Harald Oehlmann wrote:
> Am 29.02.2024 um 10:40 schrieb et99:
>> On 2/28/2024 11:41 AM, Harald Oehlmann wrote:
>>> Am 28.02.2024 um 20:25 schrieb et99:
>>>> On 2/28/2024 12:19 AM, Harald Oehlmann wrote:
>>>>> Am 28.02.2024 um 01:48 schrieb et99:
>>>>>> On 2/26/2024 12:58 AM, Harald Oehlmann wrote:
>>>>>>> Hi ET99,
>>>>>>>
>>>>>>> great analysis, thank you.
>>>>>>>
>>>>>>> Unfortunately, I can not see new information in the ticket:
>>>>>>>
>>>>>>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>>>>>>
>>>>>>> Or do you mean your post 2024-02-23 07:34:22 ?
>>>>>>>
>>>>>>> Take care,
>>>>>>> Harald
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Yes, that was what I added to the ticket.
>>>>>>
>>>>>> I probably should have mentioned that my tests, and the code I was referencing was from 9.0b1, since I just now compared tclWinPipe.c from 8.6.13 to 9.0b1 and there is a bit of difference. It hadn't occurred to me that the code would be different with respect to cmd.exe /c. It appears that in 8.6.13 there's a test that is removed in 9.0b1:
>>>>>>
>>>>>>      if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
>>>>>>
>>>>>> And that is what oehhar mentions in the ticket. I can say with confidence that the 9.0b1 code has the problem, and perhaps because that was removed.
>>>>>>
>>>>>> I didn't hand build and trace 8.6.13, so that might be doing something different. There I was using magicsplat 8.6.13, but also a tclkit 8.6.9 and this might also explain why some of the failures I got were different than what Jacob was seeing.
>>>>>>
>>>>>>
>>>>>> Sorry for any confusion I might have caused. I just sent a clarification to the ticket.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> Hi ET99,
>>>>> no, there is no confusion, no problem. Only confusing code ;-).
>>>>>
>>>>> It would be great if you could test the two proposed bug branches, if they work for you or not.
>>>>>
>>>>> Take care,
>>>>> Harald
>>>>
>>>>
>>>> I could do that but I would need to know how to get the new code. I only just learned how to build from sources on windows. I don't know how the code management system works. If you could copy out the entire file somewhere with a link, or post it somewhere on the wiki, I could grab it and do a build. It's win/tclWinPipe.c, correct? I do have a pretty good program for comparing files (beyond compare) so I could see what's different.
>>>>
>>>> -et
>>>>
>>>
>>> Yes, no problem.
>>>
>>> Go to:
>>> https://core.tcl-lang.org/tcl/login
>>> and log in as anonymous with the ASCII-Art password.
>>> Then find the two proposed branches.
>>> You may use the timeline and find the two red colored lines
>>> https://core.tcl-lang.org/tcl/timeline
>>> or you go to the ticket:
>>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>> within the 3rd comment titled:
>>> oehhar added on 2024-02-26 14:09:08:
>>> you find 2 blue links.
>>> If you press on the links, the chckin page opens.
>>> You see the proposed changes as a diff.
>>> To download, look to the 2nd line from the top titled "Downloads".
>>> I would click on "ZIP archive" to download the whole distribution.
>>>
>>> Please come back to me in case of any questions.
>>>
>>> Thank you and take care,
>>> Harald
>>
>> I tried to find it but to no avail.  I only am really in a position to build 9.0b1. When the next 9.0 beta comes out I can take a look, assuming the fix will go in there. Sorry.
>
> No, sorry. The fix will go nowhere, as nobody cares.
> I tried, I failed - end of the story....
>
> Sorry,
> Harald
>

Found this:

Modified win/tclWinPipe.c from [accbe2dfa9] to [9bed7c6415].

Ok, downloaded a file tcl-69a34921d1.zip

The code there looks very much like the code in 9.0b1, which is less code than what was in official 8.6.13.

Built it. (took me 2 hours to figure out how without clobbering my 9.0b1 directories). Fails.

The only way to get it to work was to once again, get rid of the cmd.exe /c append, like below commented out. I don't know if that breaks anything else by never doing that line, but I'm guessing it's not needed at all.

if (HasConsole()) {
createFlags = 0;
} else if (applType == APPL_DOS) {
/*
* Under NT, 16-bit DOS applications will not run unless they can
* be attached to a console. If we are running without a console,
* run the 16-bit program as an normal process inside of a hidden
* console application, and then run that hidden console as a
* detached process.
*/

startInfo.wShowWindow = SW_HIDE;
startInfo.dwFlags |= STARTF_USESHOWWINDOW;
createFlags = CREATE_NEW_CONSOLE;
// TclDStringAppendLiteral(&cmdLine, "cmd.exe /c");
} else {
createFlags = DETACHED_PROCESS;
}

Re: bat file execution

<urrun3$13u06$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13023&group=comp.lang.tcl#13023

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et9...@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: bat file execution
Date: Thu, 29 Feb 2024 23:05:07 -0800
Organization: A noiseless patient Spider
Lines: 139
Message-ID: <urrun3$13u06$1@dont-email.me>
References: <ur2vov$2lnbn$1@dont-email.me>
<ygaa5ntn48p.fsf@panther.akutech-local.de>
<e5c244d0-3634-4c64-80e6-18b9f7545256@clevelandgolf.com>
<yga5xygn6lb.fsf@panther.akutech-local.de>
<f2ddc894-05f7-4a64-b3c9-c4f23ecf17ce@clevelandgolf.com>
<ur8137$bd0$1@dont-email.me> <ur8c56$2tt8$1@dont-email.me>
<ur8tfv$6caf$1@dont-email.me> <ur95tq$bije$1@dont-email.me>
<ur9frb$ddu2$1@dont-email.me> <uraojv$mcmg$1@dont-email.me>
<urb66a$pega$1@dont-email.me> <urhjrj$2eoke$1@dont-email.me>
<urlvt7$3g7og$1@dont-email.me> <urmq9t$3ohci$1@dont-email.me>
<uro1bt$1o57$1@dont-email.me> <uro28u$223t$1@dont-email.me>
<urpjdo$f0ar$1@dont-email.me> <urpkvu$fa6h$1@dont-email.me>
<urqnfl$pcrr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 1 Mar 2024 07:05:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a3cfccf99fb72af6ff455e792021bc91";
logging-data="1177606"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Wq79GLxIr8RBC1a782JFs"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:QLSHpvnAq2Co8XWoxKwGnKck0Us=
In-Reply-To: <urqnfl$pcrr$1@dont-email.me>
Content-Language: en-US
 by: et99 - Fri, 1 Mar 2024 07:05 UTC

On 2/29/2024 11:55 AM, et99 wrote:
> On 2/29/2024 2:06 AM, Harald Oehlmann wrote:
>> Am 29.02.2024 um 10:40 schrieb et99:
>>> On 2/28/2024 11:41 AM, Harald Oehlmann wrote:
>>>> Am 28.02.2024 um 20:25 schrieb et99:
>>>>> On 2/28/2024 12:19 AM, Harald Oehlmann wrote:
>>>>>> Am 28.02.2024 um 01:48 schrieb et99:
>>>>>>> On 2/26/2024 12:58 AM, Harald Oehlmann wrote:
>>>>>>>> Hi ET99,
>>>>>>>>
>>>>>>>> great analysis, thank you.
>>>>>>>>
>>>>>>>> Unfortunately, I can not see new information in the ticket:
>>>>>>>>
>>>>>>>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>>>>>>>
>>>>>>>> Or do you mean your post 2024-02-23 07:34:22 ?
>>>>>>>>
>>>>>>>> Take care,
>>>>>>>> Harald
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Yes, that was what I added to the ticket.
>>>>>>>
>>>>>>> I probably should have mentioned that my tests, and the code I was referencing was from 9.0b1, since I just now compared tclWinPipe.c from 8.6.13 to 9.0b1 and there is a bit of difference. It hadn't occurred to me that the code would be different with respect to cmd.exe /c. It appears that in 8.6.13 there's a test that is removed in 9.0b1:
>>>>>>>
>>>>>>>      if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
>>>>>>>
>>>>>>> And that is what oehhar mentions in the ticket. I can say with confidence that the 9.0b1 code has the problem, and perhaps because that was removed.
>>>>>>>
>>>>>>> I didn't hand build and trace 8.6.13, so that might be doing something different. There I was using magicsplat 8.6.13, but also a tclkit 8.6.9 and this might also explain why some of the failures I got were different than what Jacob was seeing.
>>>>>>>
>>>>>>>
>>>>>>> Sorry for any confusion I might have caused. I just sent a clarification to the ticket.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Hi ET99,
>>>>>> no, there is no confusion, no problem. Only confusing code ;-).
>>>>>>
>>>>>> It would be great if you could test the two proposed bug branches, if they work for you or not.
>>>>>>
>>>>>> Take care,
>>>>>> Harald
>>>>>
>>>>>
>>>>> I could do that but I would need to know how to get the new code. I only just learned how to build from sources on windows. I don't know how the code management system works. If you could copy out the entire file somewhere with a link, or post it somewhere on the wiki, I could grab it and do a build. It's win/tclWinPipe.c, correct? I do have a pretty good program for comparing files (beyond compare) so I could see what's different.
>>>>>
>>>>> -et
>>>>>
>>>>
>>>> Yes, no problem.
>>>>
>>>> Go to:
>>>> https://core.tcl-lang.org/tcl/login
>>>> and log in as anonymous with the ASCII-Art password.
>>>> Then find the two proposed branches.
>>>> You may use the timeline and find the two red colored lines
>>>> https://core.tcl-lang.org/tcl/timeline
>>>> or you go to the ticket:
>>>> https://core.tcl-lang.org/tcl/info/f91ab723f3dfbc0d
>>>> within the 3rd comment titled:
>>>> oehhar added on 2024-02-26 14:09:08:
>>>> you find 2 blue links.
>>>> If you press on the links, the chckin page opens.
>>>> You see the proposed changes as a diff.
>>>> To download, look to the 2nd line from the top titled "Downloads".
>>>> I would click on "ZIP archive" to download the whole distribution.
>>>>
>>>> Please come back to me in case of any questions.
>>>>
>>>> Thank you and take care,
>>>> Harald
>>>
>>> I tried to find it but to no avail.  I only am really in a position to build 9.0b1. When the next 9.0 beta comes out I can take a look, assuming the fix will go in there. Sorry.
>>
>> No, sorry. The fix will go nowhere, as nobody cares.
>> I tried, I failed - end of the story....
>>
>> Sorry,
>> Harald
>>
>
> Found this:
>
> Modified win/tclWinPipe.c from [accbe2dfa9] to [9bed7c6415].
>
> Ok,  downloaded a file tcl-69a34921d1.zip
>
> The code there looks very much like the code in 9.0b1, which is less code than what was in official 8.6.13.
>
> Built it. (took me 2 hours to figure out how without clobbering my 9.0b1 directories). Fails.
>
> The only way to get it to work was to once again, get rid of the cmd.exe /c append, like below commented out. I don't know if that breaks anything else by never doing that line, but I'm guessing it's not needed at all.
>
>
>
>     if (HasConsole()) {
>     createFlags = 0;
>     } else if (applType == APPL_DOS) {
>     /*
>      * Under NT, 16-bit DOS applications will not run unless they can
>      * be attached to a console. If we are running without a console,
>      * run the 16-bit program as an normal process inside of a hidden
>      * console application, and then run that hidden console as a
>      * detached process.
>      */
>
>     startInfo.wShowWindow = SW_HIDE;
>     startInfo.dwFlags |= STARTF_USESHOWWINDOW;
>     createFlags = CREATE_NEW_CONSOLE;
> //    TclDStringAppendLiteral(&cmdLine, "cmd.exe /c");
>     } else {
>     createFlags = DETACHED_PROCESS;
>     }
>

As I think about this, my guess is that this is like playing chess. You have to see the effects of every move. And every change has side effects here.

So, I think the correct play is to let this code remain, but surround it with an if test for - not a .bat extension. Then everything else that could require this could still get through. What might that be? I don't know.

So, where it checks for .bat and .com, another flag should be set if it's .bat. Then use that flag to bypass the above append, but let anything else that is set to APPL_DOS use it.

Good luck. One last thing. Instead of fixing the code, one might just update the manual with instructions that I posted earlier which was a workaround.

It was,

exec {*}[auto_execok start] {} /D [file dirname $batFile] [file tail $batFile] args args ....

This works, because when "start" is used, cmd.exe doesn't require the entire command line to be in quotes.

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor