文件和流
文件名
| name.m | Mathematica 语言源文件 |
| name.nb | Mathematica 笔记本文件 |
| name.ma | Mathematica 从第3版以前的笔记本文件 |
| name.mx | 输出所有 Mathematica 表达式 |
| name.exe | MathLink 可执行程序 |
| name.tm | MathLink 模版文件 |
| name.ml | MathLink 流文件 |
Mathematica 所使用的绝大多数文件都与系统完全无关. 然而,.mx 和 .exe 文件与系统有关. 对于这些文件,按照惯例,对不同计算机系统版本的名称进行捆绑,形式如 name/$SystemID/name.
一般情况下,当用户想要引用一个文件时,Mathematica 试图使用如下方法求解名称问题:
对于形式为
的名称,在 Get 和相关函数中实现如下的进一步变换:
在 Install 中,
用来指代名称为 name.exe 的文件或目录.
流
| InputStream["name",n] | 从一个文件或者管道的输入 |
| OutputStream["name",n] | 一个文件或管道的输出 |
选项名 | 默认值 | |
| CharacterEncoding | Automatic | 用于特殊字符的编码 |
| BinaryFormat | False | 是否把文件以二进制格式处理 |
| FormatType | InputForm | 表达式的默认格式 |
| PageWidth | 78 | 每一行的字符数目 |
| TotalWidth | Infinity | 单个表达式中的最大字符数目 |
使用 Options 用户可以测试流的选项,并且使用 SetOptions 重设.
