Question
· Jun 27, 2024

Finding the Inode value for a file

The SYS.Mirror CatchupDB() method requires a System File Number/Inode value as a parameter.   I have not yet found a suitable internal method to get this value.  Is anyone aware of a utility method that would do this?   I do know I can get this value with a small amount of Python or by calling out to the OS.  However I wanted to stick with pure Objectscript in this project if possible.  

Failing in this I will use embedded python to run the line or two of Python needed to get this value.

Thank you for any hints

Discussion (5)2
Log in or sign up to continue

If the System File Numbers in question are related to the database files themselves instead of the journal files, there's a query in SYS.Database called "CompactLocalList" that might get you what you need. Note: It seems that the query calls in SYS.Database need to be called from the %SYS namespace.

Try this (ugly, but hopefully useful) code snippet, and see if it gets you what you need:

zn "%sys"
set q = ##class(%SQL.Statement).%New()
set status = q.%PrepareClassQuery("SYS.Database","CompactLocalList")
set rset = q.%Execute()
while rset.%Next() { write !,rset.%Get("Directory"),*9,rset.%Get("SFN") }
w q.%Close()

Here's the documentation page for the SYS.Database class: https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=SYS.Database

and this will take you directoy to CompactLocalList.

There's one or two other calls that mention SFN's, so there might be other clues in the documentation referenced above.

Hope this helps!