Files and Streams

File Names
name.m
Wolfram Language source file
name.nb
Wolfram System notebook file
name.ma
Wolfram System notebook file from before Version 3
name.mx
Wolfram Language expression dump
name.exe
WSTP executable program
name.tm
WSTP template file
name.ml
WSTP stream file
Conventions for file names.
Most files used by the Wolfram System 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, the Wolfram System tries to resolve its name as follows:
For names of the form name` the following further translations are done in Get and related functions:
  • A file name.mx is used if it exists.
  • If name.mx is a directory, then name.mx/$SystemID/name.mx is used if it exists.
  • A file name.m is used if it exists.
  • If name is a directory, then the file name/init.m is used if it exists.
  • In Install, name` 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
    Types of streams.
    option name
    default value
    CharacterEncodingAutomatic
    encoding to use for special characters
    BinaryFormatFalse
    whether to treat the file as being in binary format
    FormatTypeInputForm
    default format for expressions
    PageWidth78
    number of characters per line
    TotalWidthInfinity
    maximum number of characters in a single expression
    Options for output streams.
    You can test options for streams using Options, and reset them using SetOptions.