DumpSave["file.mx", symbol]
writes definitions associated with a symbol to a file in internal Mathematica 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.


  • DumpSave writes out definitions in a binary format that is optimized for input by Mathematica.
  • 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 can only be read on the same type of computer system on which they were written.
  • DumpSave will not preserve open stream and link objects.
  • Files written by DumpSave conventionally have names that end with .mx.
  • 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 Mathematica by using the command-line option.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Save all definitions for a function in a binary file:

Click for copyable input
Click for copyable input

Set the directory to a place for temporary files:

Click for copyable input

Save all definitions for f:

Click for copyable input

Clear definitions for f:

Click for copyable input

Restore the definitions for f from the file:

Click for copyable input
Click for copyable input

Reset to the original directory:

Click for copyable input
New in 3
New to Mathematica? Find your learning path »
Have a question? Ask support »