8 Persistency
Persistency is already possible by exporting and importing a context
as a .ctx file, as presented in Section 5.3.
However importing a context can be time-consuming as all internal data
structures have to be recomputed. For this reason another format is
used by commands in the file menu (New..., Open..., Save, Save as..., Close): binary files with extent .lis. They allow opening a context as saved in a previous section
in a short time. When saving a context both .lis and .ctx
are produced. Indeed the .ctx version is more robust to changes
w.r.t. the internal structures of Camelis and the chosen
application. When opening a .lis file from a former version,
Camelis will suggest to regenerate the context from the .ctx file.
When launching Camelis applications, some options and arguments can be given:
-
The option -readonly controls whether the user has
readonly access on opened contexts. Without this option, when
opening a context, either it has not been opened by another user
then a lock is put on it and the user has write access, or it has
already been opened (there is a lock) and the user has readonly
access on this context. In the latter case, the user can still save
the context in another file, because there is one lock per context.
- A single .lis file can be given as the initial context.
Otherwise the context is initially empty.
- Several .ctx files can be given as contexts to be imported
in the initial context. They are imported in the specified order.
If no file is passed as an argument, then a default .ctx file is
imported. It is useful to have default actions on objects available
when starting Camelis. The location of the default is
$(HOME)/.camelis.ctx on Linux.