This seems like a simple question due to lack of experience, but I can't seem to find an answer through searching. I am trying to read back a symbol from a DumpSave
:
DumpSave[NotebookDirectory[] <> "mySymbol.mx", mySymbol]
Here, using NotebookDirectory[] got my file in the current directory like I wanted, but when I try to use either of the following with Get
, it fails:
<< NotebookDirectory[] <> "DiscreteTreatmentRegion.mx";
<< Evaluate[NotebookDirectory[] <> "Mysymbol.mx"];
It seems to me like it is not evaluating the filename correctly, since since it gives the message 'Cannot open ("NotebookDirectory[]").'
How can I get this to work? Or is there a better way to do what I am trying to do.
<< (NotebookDirectory[] <> "defs.mx")
works for me in a similar situation. Try closing MMA, then loading the notebook in question and running your second line again. Obviously the notebook needs to be saved. $\endgroup$StringJoin
(<>
) binds more loosely thanGet
(<<
), it appears. the first example is interpreted asGet[NotebookDirectory[]] <> "file.mx"
, but the second line withEvaluate
should work properly. $\endgroup$