DumpSave

DumpSave["file.mx",symbol]

writes definitions associated with a symbol to a file in internal Wolfram System format.

DumpSave["file.mx","context`"]

writes out definitions associated with all symbols in the specified context.

DumpSave["file.mx",{object1,object2,}]

writes out definitions for several symbols or contexts.

DumpSave["package`",objects]

chooses the name of the output file based on the computer system used.

Details and Options

  • DumpSave writes out definitions in a binary format that is optimized for input by the Wolfram Language.
  • Each file has a plain text header identifying its type and contents.
  • Files written by DumpSave can be read by Get.
  • Files written by DumpSave cannot be exchanged between operating systems that differ in $SystemWordLength.
  • DumpSave will not preserve open stream and link objects.
  • Files written by DumpSave conventionally have names that end with .mx.
  • DumpSave works with local objects.
  • DumpSave["package`",] writes a file with a name such as package.mx/(value of $SystemID)/package.mx.
  • You can use DumpSave["file","s"] to write out the definition for the value of a symbol s itself.
  • You can typically read a dump file when you start the Wolfram System by using the initfile commandline option.
  • DumpSave[File["file.mx"],] is also supported.

Examples

open allclose all

Basic Examples  (1)

Save all definitions for a function in a binary file:

Set the directory to a place for temporary files:

Save all definitions for f:

Clear definitions for f:

Restore the definitions for f from the file:

Reset to the original directory:

Scope  (1)

Save definitions to a file specified as a File object:

Properties & Relations  (1)

Local objects can be used with DumpSave to save definitions persistently:

Clear definitions for f:

Restore the definitions for f from the local object:

Wolfram Research (1996), DumpSave, Wolfram Language function, https://reference.wolfram.com/language/ref/DumpSave.html (updated 2016).

Text

Wolfram Research (1996), DumpSave, Wolfram Language function, https://reference.wolfram.com/language/ref/DumpSave.html (updated 2016).

CMS

Wolfram Language. 1996. "DumpSave." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/DumpSave.html.

APA

Wolfram Language. (1996). DumpSave. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DumpSave.html

BibTeX

@misc{reference.wolfram_2024_dumpsave, author="Wolfram Research", title="{DumpSave}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/DumpSave.html}", note=[Accessed: 18-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_dumpsave, organization={Wolfram Research}, title={DumpSave}, year={2016}, url={https://reference.wolfram.com/language/ref/DumpSave.html}, note=[Accessed: 18-December-2024 ]}