Skip to content
Tcl Source Code View Ticket
Login

View Ticket

auto_execok does not check executability on Windows

Deletede21fc32c2aaa7cd019815dde0249386021f4c74dCreated 11 years agoUpdated 199 days ago
Descriptionwiki2016-03-08 14:35:59
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].
danckaertwiki2016-03-08 14:37:53

I've attached a patch to fix this.

danckaertplain2016-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.
apnadkarnimarkdown2026-05-18 10:34:26

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

Log in (anonymous is fine) to add a comment.