Hi all,<br><br>I don't know if my first post just didn't make it, or got ignored because I inadvertently offended someone, or perhaps it asked too boring a question. I am trying again in the hope that it just got missed.<br>
<br>What I need to do is find out, at run time, which info items (e.g. heap_size)
process_info/2 supports. This is so I don't have to go changing code
every time an item is added (or removed, which seems unlikely). What I
have done is use
the process_info/1 BIF (which I know is for debugging only) to get a list of supported info items, something
like this:<br>
<br><span style="font-family: courier new,monospace;">5> [K || {K,_} <- process_info(pid(0,0,0))]. </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[registered_name,current_function,initial_call,status,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> message_queue_len,messages,links,dictionary,trap_exit,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> error_handler,priority,group_leader,total_heap_size,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> heap_size,stack_size,reductions,garbage_collection,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> suspending]</span><br>
<br>Short of hard-coding the names of all
the info items, or scanning the documentation at run-time, is there any "legal" way to do what I want to do other than what I have described?<br>
<br>Regards,<br><font color="#888888">Edwin Fine</font>