Load and Save - lms-org/lms GitHub Wiki
LMS provides a set methods for modules saving to files or loading from files. Instead of setting a save path in every module, LMS allows you to set one global path via command line flags.
Saving
LMS is saving files in ~/.lmslog
by default. When the ./lms --enable-save
is given on the command line, LMS will automatically create a unique directory
named ~/.lmslog/YYYY-MM-DDTHH-MM-SSZ
.
Modules may now request the path to
a file by executing saveLogFile("save.dat")
or saveLogDir("images")
for
a directory. You must check availability of the saveLog*
methods by calling
isEnableSave()
beforehand.
You may use --enable-save-tag "What I was doing"
to append a tag to the
automatically chosen directory name. This may help you later to find
the correct path for loading.
Loading
LMS is loading files from ~/.lmslog
by default. When
./lms --enable-load 2016-01-01T12-00-00Z
is given on the command line, LMS
will set the load path to ~/.lmslog/2016-01-01T12-00-00
. It is also allowed
to put relative or absolute paths like /tmp/logs/2016-01-01T12-00-00Z
.
Modules may now call loadLogFile("save.dat")
or loadLogDir("images")
in
order to get appropriate loading paths. You must check availability of the
loadLog*
methods by calling isEnableLoad()
beforehand.