PickleExample
,
uses pickles to take snapshot of its internal
database into disk, and then load it later.
Save
to
see how to save an object to a stream. The important call is:
Pickle.Write (wr, input_set);where
wr
is a writer to the database file.
Load
to
see how to save an object to disk. The important call is:
input_set = Pickle.Read (rd);where
rd
is a reader for the database file.
show, quit, reset, save, loadAny other string gets inserted into the database. Try the following sequence:
show
, you see a few items in the database
save
, the data is saved into database
reset
, the database is reset to null
load
, the data is loaded from the database
show
, the initial list of items re-appears