Cache and IRIS: How to identify system namespaces?
I am trying to locate a method that would allow me to differentiate between InterSystems preinstalled/system namespaces and "our own" namespaces. I am interested both in Cache and Iris answers if they are different. Yes, I can list what to disregard, like if not HSLIB or if not DOCBOOK but hoping for a more universal and elegant answer.
Product version: IRIS 2022.1
In the absence of an Intersystems' prescribed method I would set up a global variable with extra information on each namespace, e.g.
^%ZSYS("NAMESPACE","SYS")="IRIS"
^%ZSYS("NAMESPACE","LIVE")="CUSTOMER PRODUCTION"
The global variable with % at the start means it can be seen from all namespaces. You can add whatever information you like to it like the difference between production and non-prod etc.
Maybe it can help,
In the SYS.Database Class you can find the IsSystemDB(Directory) method that returns whether it is a system database.
It works on Caché and IRIS.
Documentation IsSystemDB - IRIS
Documentation IsSystemDB - Caché
Examples:
That's exactly what I was looking for!