GXSBF class¶
-
class
GXSBF
(handle=0)[source]¶ 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)[source]¶ 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)[source]¶ Fills an
GXLST
with 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
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.
-
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
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
-