DumpSave
詳細とオプション
- DumpSaveによる定義情報の書出しは,Wolfram言語への入力に最適化されたバイナリ形式で行われる.
- 出力ファイルにはファイル形式と内容を表したテキスト記述のヘッダ部が設けられる.
- DumpSaveを使い作成したファイルは,Getを使うことで読み込むことができる.
- DumpSaveで作成したファイルは,$SystemWordLengthが異なるオペレーティングシステム間では交換できない.
- DumpSaveは,開いたストリームやリンクオブジェクトを保存しない.
- DumpSaveで作成したファイルには,通常,拡張子 .mxがファイル名に付加される.
- DumpSaveはローカルオブジェクトに使うことができる.
- DumpSave["package`",…]を使うと,作成される出力ファイルには書式 package.mx/ ($SystemIDの値)/package.mxの名前が付けられる.
- DumpSave["file","s"]の書式を使うことで,シンボル s の値を定義した式を書き出すことができる.
- 通常,Wolframシステムが起動する際に,initfileコマンドラインのオプションを使ってダンプファイルを読み込むことができる.
- DumpSave[File["file.mx"],…]もサポートされている.
例題
すべて開く すべて閉じる例 (1)
f[x_Real] := x ^ 2 + 1;f[x_ ? NumericQ] := N[x ^ 2 + 1]file = CreateFile[];DumpSave[file, f]Clear[f]DownValues[f]Get[file]DownValues[f]スコープ (3)
local`f[x_] := 2x
local`g[x_] := x^2
local`h[x_] := 2^xComap[{local`f, local`g, local`h}, 10]SetDirectory[$TemporaryDirectory]DumpSave["local.mx", "local`"]Clear["local`*"]Comap[{local`f, local`g, local`h}, 10]<<"local`"Comap[{local`f, local`g, local`h}, 10]Remove["local`*"]
ResetDirectory[];l2`f[x_] := 2x
l2`g[x_] := x^2
l2`h[x_] := 2^x
l3`f[x_] := 3x
l3`g[x_] := x^3
l3`h[x_] := 3^xComap[{l2`f, l2`g, l2`h, l3`f, l3`g, l3`h}, 10]file = CreateFile[];
DumpSave[file, {"l2`", "l3`g"}]Clear[RegularExpression["l[23]`.*"]]Comap[{l2`f, l2`g, l2`h, l3`f, l3`g, l3`h}, 10]Get[file]コンテキスト"l2`"の関数はすべて再び動作するようになったが,gだけがコンテキスト"l3`"に保存され回復された:
Comap[{l2`f, l2`g, l2`h, l3`f, l3`g, l3`h}, 10]Remove[RegularExpression["l[23]`.*"]]Fileオブジェクトで指定されたファイルに定義を保存する:
file = CreateFile[];DumpSave[File[file], f]特性と関係 (1)
DumpSaveをローカルオブジェクトと一緒に使って定義を永久的に保存することができる:
f[x_Real] := x ^ 2 + 1;
f[x_ ? NumericQ] := N[x ^ 2 + 1]DumpSave[LocalObject["f"], f]Clear[f]Get[LocalObject["f"]]Definition[f]テクニカルノート
関連するガイド
-
▪
- パッケージの開発 ▪
- 時間の測定と最適化 ▪
- ファイル内のWolfram言語式 ▪
- ファイル ▪
- ローカルオブジェクト
履歴
1996 で導入 (3.0) | 2014 で更新 (10.0) ▪ 2016 (11.0)
テキスト
Wolfram Research (1996), DumpSave, Wolfram言語関数, https://reference.wolfram.com/language/ref/DumpSave.html (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_2026_dumpsave, author="Wolfram Research", title="{DumpSave}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/DumpSave.html}", note=[Accessed: 07-October-2026]}
BibLaTeX
@online{reference.wolfram_2026_dumpsave, organization={Wolfram Research}, title={DumpSave}, year={2016}, url={https://reference.wolfram.com/language/ref/DumpSave.html}, note=[Accessed: 07-October-2026]}