Save
Save("path-to-filename", expression)
if the file system is enabled, export the
FullDefinition
of theexpression
to the “path-to-filename” file. The saved file can be imported withGet
.
Save("path-to-filename", "Global`*")
if the file system is enabled, export the
FullDefinition
of all symbols in the"Global
*”` context to the “path-to-filename” file.
Examples
Save a definition with dependent symbol definitions into temporary file
>> g(x_) := x^3;
>> g(x_,y_) := f(x,y);
>> SetAttributes(f, Listable);
>> f(x_) := g(x^2);
>> temp = FileNameJoin({$TemporaryDirectory, \"savedlist.txt\"});Print(temp);
>> Save(temp, {f,g})
>> ClearAll(f,g)
>> "Attributes(f)
>> {f(2),g(7)}
>> Get(temp)
>> {f(2),g(7)}{64,343}
>> Attributes(f){Listable}
Related terms
BinaryDeserialize, BinarySerialize, ByteArray, ByteArrayQ, Export, Import
Implementation status
- ☑ - partially implemented