This Tcl command is used to open a storage. It takes one, two or three arguments:
The storage name is a legal name for the e4Graph driver selected. The driver name defaults to "Metakit 2.0". The open mode is either "r" or "w". If "r" is selected, the storage is opened in read-only mode, and if "w" is selected, the storage is opened in read-write mode. Currently the third argument is not checked for legality and is not respected; the storage is always opened in read-write mode.package require TGraph 1.0 tgraph::open storage-name ?driver-name? ?open-mode?
The tgraph::open command returns a Tcl object representing the new storage just opened. If a storage is opened multiple times, the same Tcl object is returned on subsequent calls to tgraph::open. The Tcl storage object can be used to operate on the e4Graph storage object.
Here is an example showing how to open an e4Graph storage from Tcl and save the returned object in a Tcl variable for future use.
The tgraph::isopen Commandset mystorage [tgraph::open foo.db]
This Tcl command takes one or two arguments; the first argument is a storage name, and the optional second argument is a driver name. The driver name defaults to "Metakit 2.0". The command returns true if the storage named by the first argument is open in this interpreter using the specified or defaulted driver.
The following code snippet shows how the tgraph::isopen command could be used:
The tgraph::transfer Commandpackage require TGraph 1.0 set mystorage [tgraph::open foo.db] ... if {[tgraph::isopen foo.db]} { ... }
This Tcl command is used to transfer a storage to another interpreter. It takes two arguments, a storage and an interpreter, as shown by the following example:
The storage mystorage is transferred to the interpreter otherinterp. After this command is executed, the storage becomes inaccessible in the current interpreter and is accessible only in otherinterp. All objects that were exported to Tcl from the storage also become inaccessible in this interpreter, and all callbacks for events on this storage are removed. The interpreter into which the storage is transferred now can operate on the e4Graph storage object.package require TGraph 1.0 set otherinterp [interp create] set mystorage [tgraph::open foo.db] tgraph::transfer $mystorage $otherinterp