GXSBF class¶
- class GXSBF(handle=0)[source]¶
GXSBF class.
The
GXSBFclass 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 ownGXSBFobject, which may be accessed using theh_get_sys,h_get_dbandh_get_mapfunctions. To access data in a file, or create a new file in theGXSBFobject, call the CreatSBF_BF function (seeGXBF), which will return aGXBFobject to use.- create(file, status)[source]¶
Create a child
GXSBFobject inside anGXSBF.- Parameters:
file (str) – Directory name to open / create
status (int) – SBF_OPEN constants
- Returns:
GXSBFobject, terminates if fails.- Return type:
New in version 5.0.
License: Geosoft Open License
- create_obj_list(lst, type)[source]¶
Fills an
GXLSTwith embedded storage names of anGXSBF.- Parameters:
type (int) – SBF_TYPE constants
New in version 5.0.7.
License: Geosoft Open License
Note: Function will populate an
GXLSTobject with embedded files (SBF_TYPE_FILES), directories (SBF_TYPE_DIRS), or both (passSBF_TYPE_BOTH) in anGXSBF. Along with the Name of the file or directory, a constant “dir” or “file” string is written to theGXLSTalso.
- del_dir(dir)[source]¶
Delete a directory (storage) from this storage.
- Parameters:
dir (str) – Dir/Storage Name
New in version 5.0.
License: Geosoft Open License
- del_file(file)[source]¶
Delete a file from this storage.
- Parameters:
file (str) – File Name
New in version 5.0.
License: Geosoft Open License
- exist_dir(dir)[source]¶
Check to see if a directory (storage) exists inside this storage.
- Parameters:
dir (str) – Dir/Storage Name
- Returns:
0 - Does not exist 1 - Exists
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- exist_file(file)[source]¶
Check to see if a file exists inside this storage.
- Parameters:
file (str) – File Name
- Returns:
0 - Does not exist 1 - Exists
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod h_get_db(db)[source]¶
Get the embedded file storage from a database.
New in version 5.0.
License: Geosoft Open License
- classmethod h_get_map(map)[source]¶
Get the embedded file storage from a map.
New in version 5.0.
License: Geosoft Open License
- classmethod h_get_sys()[source]¶
Get the main embedded file storage (in workspace).
New in version 5.0.
License: Geosoft Open License
- is_null()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- save_log(dir, file, file_save, p5)[source]¶
Save an embedded file to an ASCII file.
- Parameters:
dir (str) – Directory name in the Parent
GXSBFfile (str) – File name in the directory
file_save (str) – File to save as (as an ASCII file)
p5 (int) – Append Mode: 0 - New file, 1 - Append file
New in version 5.0.
License: Geosoft Open License
SBF_OPEN constants¶
GXSBF Open defines
SBF_TYPE constants¶
GXSBF Object type defines