Tcl Source Code

View Ticket
Login
Ticket UUID: e21fc32c2aaa7cd019815dde0249386021f4c74d
Title: auto_execok does not check executability on Windows
Type: Patch Created on: 2016-03-08 14:35:59
Submitter: danckaert Assigned to: nobody
Subsystem: 38. Init - Library - Autoload Severity: Minor
Priority: 5 Medium Last modified: 2026-05-18 10:34:26
Status: Deleted Closed by: apnadkarni
Resolution: None Closed on: 2026-05-18 10:34:26
Version: 8.6.5
Description:

On Windows, [auto_execok] lies when there is a (non-executable) file without extension next to the same file with .exe extension. For example, when the current directory contains "foo" and "foo.exe", [auto_execok foo] will return "foo". This can be fixed by checking for executability before returning. This was probably not done in the past because [file executable] was not reliable on Windows. However, these issues were fixed in http://core.tcl.tk/tcl/info/23cc9bf170fd4489. So I think [file executable] can now safely be used in [auto_execok].

User Comments:
danckaert added on 2016-03-08 14:37:53:

I've attached a patch to fix this.


danckaert added on 2016-03-09 16:12:33:
Sorry, apparently [file executable] only checks the file extension, which is not sufficient either. Furthermore, there are other issues with auto_execok. So forget this patch. I will delete this ticket and create another one instead.

apnadkarni added on 2026-05-18 10:34:26:

Needs a two-part fix. One is partly fixed in TIP 753. Other part pending is file executable.


Attachments: