On 4/18/21 7:36 AM, Arash Khosravi wrote:
> On Saturday, April 17, 2021 at 10:21:29 PM UTC-4, Gerald Lester wrote:
>> On 4/17/21 7:08 PM, Arash Khosravi wrote:
>>> I'm super new to tcl and I want to see the exact location of the proc or libraries which been used in a script, I'm using TCL 8.4 (can not update) in 8.7 the specific functionality been added but it does not work in 8.4
>>> example:
>>> sourcefile /home/dkf/develop/tcl/library/parray.tcl
>>>
>>> 8.7
>>> % dict filter [tcl::unsupported::getbytecode proc parray] key sourcefile
>>> sourcefile /home/dkf/develop/tcl/library/parray.tcl
>>>
>> The long answer is maybe -- this short answer is no.
>>
>> Since you say you can not upgrade, I'm assuming that you are using Tcl
>> embedded in some product. That product can cause procedures to be
>> defined that do not exist anywhere on disk.
>>
>> Now if you can early on in the initialization of the interpreter (my
>> guess is this is unlikely) you could redefine the source and open
>> commands to track access and log them out.
>>
>> A better question is: why do you want to do this?
>>
>> --
>> +----------------------------------------------------------------------+
>> | Gerald W. Lester, President, KNG Consulting LLC |
>> | Email:
Gerald...@kng-consulting.net |
>> +----------------------------------------------------------------------+
>
> Thank for your kind answer,
> so you mean the only way to achieve the goal is to define the commands on the initialization of interpreter, and track them procs, those commands should be added to each proc?