mof

mof names the file that the next write makes.

Syntax

mof file_name

file_name is one word and may include a path. It may not be empty.

What it does

mof sets the name that write uses. The name stays in force until the next mof, and a file that James has already written keeps its name. The first write under a name uses it as it stands. A second write under the same name appends .0001, a third .0002, and so on. A new name starts its own count.

When James applies it

At the next write. mof is legal in the Control, Part and Merge phases.

Rules James adds

  • A mof in the script governs over the flag -o of the command line. With -o foo.n and a script that holds mof a.n, James writes a.n and no foo.n.
  • A mof with no name is an error (E0104).

Diagnostics

  • E0104: the command has no file name.

Example

The script tests/corpus/141-write-suffix-per-name/input.tg, which make test runs:

block 1 2;1 2;1 2;0 1;0 1;0 1;
endpart
merge
neutral
write
write
mof other.out
write
mof trugrdo
write

The first two write commands make trugrdo and trugrdo.0001. The mof other.out sends the third to other.out. The mof trugrdo returns to the first name, so the fourth is trugrdo.0002, because James counts each name on its own.

See also


James 0.3.1.

This site uses Just the Docs, a documentation theme for Jekyll.