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
I don't see that in the documentation - final classmethod CatchupDB(DBList As %String, JournalLocation As %String = "", ByRef DBErrList As %String) as %Integer
Alexander, It is in the online documentation for the class under the parameters
https://docs.intersystems.com/irisforhealth20241/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=SYS.Mirror#CatchupDB
Input Parameters:
%SYS>s db=##class(SYS.Database).%OpenId("C:\InterSystems\IRIS\mgr\user")
%SYS>w db.SFN
8
%SYS>
Enrico,
Interesting. Thanks for point this out! I see that this works, but the property is not documented in the Class Reference so I might never have found this.
https://docs.intersystems.com/irisforhealthlatest/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=SYS.Database
Regards,
Rich Taylor
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!