Question
· Jul 26, 2016

Find mapped file

Hello, guys.

I have a set of file names (e.g. file.cls, file2.mac and so on) and I need to check whether these files are mapped in %ALL or current namespace.

I found that if I open Globals in the current namespace I can see mapped packages. And If I open this global I see all files that are  to this namespace and %SYS. The problem is these files are enumerated in a json object(apparently)

ex. "{""class"":{""%Activate.Enum"":{},""%Activate.GenericObject"":{""CreateObject"":0,""GetObject"":0},""%Activate.HandleEvents"")

But, is there a way to determine whether this file is mapped using some method? 

P.S. Probably, I can just use $find(textInGlobal, filename)

Discussion (1)0
Log in or sign up to continue

You should know, that namespace it is a just definition in which databases stored some types of data, and how it mapped.

So, you can only check in which database package stored

write ##class(%SYS.Namespace).GetPackageDest("SAMPLES","%Activate.Enum")
^/opt/cache/mgr/cachelib/

delimited output, first part is a system like in ECP-configuration, and second part is a database path

you can compare this path with default path for packages in this namespace.

w ##class(%SYS.Namespace).GetPackageDest("SAMPLES","")
^/opt/cache/mgr/samples/