GXSBF class¶
-
class
GXSBF
(handle=0)¶ GXSBF class.
The
GXSBF
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 ownGXSBF
object, which may be accessed using theh_get_sys
,h_get_db
andh_get_map
functions. To access data in a file, or create a new file in theGXSBF
object, call the CreatSBF_BF function (seeGXBF
), which will return aGXBF
object to use.-
create
(file, status)¶ Create a child
GXSBF
object inside anGXSBF
.Parameters: - file (str) – Directory name to open / create
- status (int) – SBF_OPEN constants
Returns: GXSBF
object, terminates if fails.Return type: New in version 5.0.
License: Geosoft Open License
-
create_obj_list
(lst, type)¶ Fills an
GXLST
with embedded storage names of anGXSBF
.Parameters: - lst (GXLST) –
GXLST
handle - type (int) – SBF_TYPE constants
New in version 5.0.7.
License: Geosoft Open License
Note: Function will populate an
GXLST
object 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 theGXLST
also.- lst (GXLST) –
-
del_dir
(dir)¶ 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)¶ Delete a file from this storage.
Parameters: file (str) – File Name New in version 5.0.
License: Geosoft Open License
-
exist_dir
(dir)¶ 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)¶ 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)¶ Get the embedded file storage from a database.
Parameters: db (GXDB) – Database Returns: GXSBF
ObjectReturn type: GXSBF New in version 5.0.
License: Geosoft Open License
-
classmethod
h_get_map
(map)¶ Get the embedded file storage from a map.
Parameters: map (GXMAP) – GXMAP
objectReturns: GXSBF
ObjectReturn type: GXSBF New in version 5.0.
License: Geosoft Open License
-
classmethod
h_get_sys
()¶ Get the main embedded file storage (in workspace).
Returns: GXSBF
ObjectReturn type: GXSBF New in version 5.0.
License: Geosoft Open License
-
is_null
()¶ 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)¶ Save an embedded file to an ASCII file.
Parameters: - dir (str) – Directory name in the Parent
GXSBF
- file (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
- dir (str) – Directory name in the Parent
-