I am trying to write a TCL/TK Script that accesses an INI File with the command [::ini::open DBW.ini]. I am using the inifile package for this and am trying to run on wish for the gui. However, wish answers with "couldn't open "DBW.ini": no such file or directory". The odd thing about this is, that I can run this Code in the VSCode extension "Code Runner". Code Runner is configured to access the same wish Compiler that I'm trying to run on my Windows System.
Why would I be able to run this Code through VSCode, but when im using the wish Compiler directly it throws an error message.
Thank you in advance
CodePudding user response:
Most likely your Tcl code is not being executed in the same directory as where the DBW.ini file is. The Tcl command pwd
will return the directory where the code is executing. If this is not where the ini file is, a simple fix would be to specify the whole path to the file when you try to open it, something like:
[::ini::open C:/some/where/DBW.ini]