MATHEMATICA TUTORIAL
Files and Streams
File Names
| name.m | Mathematica language source file |
| name.nb | Mathematica notebook file |
| name.ma | Mathematica notebook file from before Version 3 |
| name.mx | Mathematica expression dump |
| name.exe | MathLink executable program |
| name.tm | MathLink template file |
| name.ml | MathLink stream file |
Most files used by Mathematica are completely system independent. .mx and .exe files are however system dependent. For these files, there is a convention that bundles of versions for different computer systems have names with forms such as name/$SystemID/name.
In general, when you refer to a file, Mathematica tries to resolve its name as follows:
For names of the form
the following further translations are done in Get and related functions:
In Install,
is taken to refer to a file or directory named name.exe.
Streams
| InputStream["name",n] | input from a file or pipe |
| OutputStream["name",n] | output to a file or pipe |
option name | default value | |
| CharacterEncoding | Automatic | encoding to use for special characters |
| BinaryFormat | False | whether to treat the file as being in binary format |
| FormatType | InputForm | default format for expressions |
| PageWidth | 78 | number of characters per line |
| TotalWidth | Infinity | maximum number of characters in a single expression |
You can test options for streams using Options, and reset them using SetOptions.
