BBjOpenFileInfo

Description

In BBj 6.0 and higher, the BBjVector of BBjOpenFileInfo objects provides programmatic access to information about all files open within the current BBjServices environment. It is safe to query this information, but invoking the BBjOpenFileInfo::forceClose method can destabilize your application. This method should be used with extreme caution.

Creation

BBjAPI > BBjAdmin > BBjOpenFileInfo

A BBjVector containing all active BBjOpenFileInfo objects is created through the following BBjAdmin object method:

Return Value

Method

BBjVector

getOpenFileInfos()

Methods of BBjOpenFileInfo

Return Value

Method

void

forceClose()

long

getExtracted()

string

getFilename()

string

getHost()

string

getIDString()

int

getOpenType()

string

getOpenTypeString()

string

getUser()

boolean

isAdvisoryLocking()

boolean

isLocked()

boolean

isReadOnly()

Remarks

None.

Constants

None.

Example

rem ' BBjOpenFileInfo Example

rem ' Retrieve all active BBjOpenFileInfo Objects
input "Enter User ID: ",userid$
if userid$ = "" then userid$ = "admin"
input "Enter Password: ",password$
if password$ = "" then password$ = "admin123"
admin! = bbjapi().getAdmin(userid$,password$)
vector! = admin!.getOpenFileInfos()
if (vector!.size()) then
    for i=0 to vector!.size()-1
        print fill(72,"=")
        info! = vector!.get(i)
        print "File Name: ",info!.getFilename()
        print "  Open ID: ",info!.getIDString()
        print "  User ID: ",info!.getUser()
        print "Host Name: ",info!.getHost()
        print "   Locked: ",fnyesno$(info!.isLocked())
        print "Extracted: ",fnumeric$(info!.getExtracted())
        print " Advisory: ",fnyesno$(info!.isAdvisoryLocking())
        print " Readonly: ",fnyesno$(info!.isReadOnly())
        print "Open Type: ",info!.getOpenTypeString()
    next i
endif
def fnyesno$(boolean)=iff(boolean,"Yes","No")
def fnumeric$(number)=iff(number>=0,str(number),"None")

See Also

BBjAPI

BBj Object Variables

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.