GXSBF class

class geosoft.gx.GXSBF
The SBF class provides a means of storing data in a
file-type directory structure within a workspace, database
or map. Each of these three objects contains its own SBF object,
which may be accessed using the geosoft.gx.GXSBF.h_get_sys(), geosoft.gx.GXSBF.h_get_db() and
geosoft.gx.GXSBF.h_get_map() functions. To access data in a file, or create a
new file in the SBF object, call the CreatSBF_BF function (see BF),
which will return a BF object to use.
create((str)arg1, (int)arg2) → GXSBF:
Create a child SBF object inside an SBF.
Parameters:
Returns:

SBF object, terminates if fails.

Return type:

geosoft.gx.GXSBF

New in version 5.0.0.

create_obj_list((GXLST)arg1, (int)arg2) → None:
Fills an LST with embedded storage names of an SBF.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.7.

Note:

Function will populate an LST object with embedded files (SBF_TYPE_FILES),
directories (SBF_TYPE_DIRS), or both (pass SBF_TYPE_BOTH) in an SBF.
Along with the Name of the file or directory, a constant "dir" or "file" string is written
to the LST also.
del_dir((str)arg1) → None:
Delete a directory (storage) from this storage.
Parameters:arg1 (str) – Dir/Storage Name
Returns:Nothing
Return type:None

New in version 5.0.0.

del_file((str)arg1) → None:
Delete a file from this storage.
Parameters:arg1 (str) – File Name
Returns:Nothing
Return type:None

New in version 5.0.0.

exist_dir((str)arg1) → int:
Check to see if a directory (storage) exists inside this storage.
Parameters:arg1 (str) – Dir/Storage Name
Returns:0 - Does not exist 1 - Exists
Return type:int

New in version 5.0.0.

exist_file((str)arg1) → int:
Check to see if a file exists inside this storage.
Parameters:arg1 (str) – File Name
Returns:0 - Does not exist 1 - Exists
Return type:int

New in version 5.0.0.

static h_get_db((GXContext)ctx, (GXDB)arg1) → GXSBF:
Get the embedded file storage from a database.
Parameters:
Returns:

SBF Object

Return type:

geosoft.gx.GXSBF

New in version 5.0.0.

static h_get_map((GXContext)ctx, (GXMAP)arg1) → GXSBF:
Get the embedded file storage from a map.
Parameters:
Returns:

SBF Object

Return type:

geosoft.gx.GXSBF

New in version 5.0.0.

static h_get_sys((GXContext)ctx) → GXSBF:
Get the main embedded file storage (in workspace).
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:SBF Object
Return type:geosoft.gx.GXSBF

New in version 5.0.0.

is_null() → bool

Check if the instance of geosoft.gx.GXSBF is null (undefined)

Returns:True if this is a null instance of geosoft.gx.GXSBF, False otherwise.
Return type:bool`
static null() → GXSBF

A null (undefined) instance of geosoft.gx.GXSBF

Returns:A null geosoft.gx.GXSBF
Return type:geosoft.gx.GXSBF
save_log((str)arg1, (str)arg2, (str)arg3, (int)arg4) → None:
Save an embedded file to an ASCII file.
Parameters:
  • arg1 (str) – Directory name in the Parent SBF
  • arg2 (str) – File name in the directory
  • arg3 (str) – File to save as (as an ASCII file)
  • arg4 (int) – Append Mode: 0 - New file, 1 - Append file
Returns:

Nothing

Return type:

None

New in version 5.0.0.

SBF_OPEN constants

SBF Open defines
gx.SBF_READ = 0
Read only
gx.SBF_READWRITE_NEW = 1
Read/write - erases structured file
gx.SBF_READWRITE_OLD = 2
Read/write - open and append onto pre-existing structured file

SBF_TYPE constants

SBF Object type defines
gx.SBF_TYPE_DIRS = 1
Embedded directory names
gx.SBF_TYPE_FILES = 2
Embedded file names
gx.SBF_TYPE_BOTH = 3
Embedded file and directory names