Section Seven - Filer reference
This section describes the more advanced features of the Filer popdown, and should be read in conjunction with The Filer. The features described here include:
- Directories, and the hierarchical filing system
- The Command Line Interpreter, and CLI files
Here, you will find the following chapters:
- Specifying filenames in full
Describes filename syntax, filename extensions, directory structure, device specifications and wildcards.
- Additional Filer Commands
Describes commands that provide facilities for creating directories, manipulating files within the hierarchical directory structure.
- CLI files
Describes how to use the Command Line Interpreter with text files, reference of special commands for the CLI, redirecting of I/O and how to utilize this for editing BBC BASIC programs in PipeDream.
Specifying file names in full
The full form of a file name is
:DEVICE I DIRECTORY I DIRECTORY I .... /filename
where DIRECTORY and filename are each of the form
name.extension
consisting of a name of up to 12 letters or digits, followed by an optional extension of up to three letters or digits,
The following extensions are used for system functions:
| For +K and +S CLI files |
| For BOOT.CLI; see CLI files, p. 173. |
| For PipeDream multi-file List file |
DIRECTORY is a directory name subject to the same constraints as filename.
In addition the following symbols can be used:
../name | Parent directory of name |
. | Current directory |
Device specifications
DEVICE can be specified as one of the following:
Specification | Effect | |
---|---|---|
:RAM.0 | RAM in slot 0 (internal memory) | |
| RAM in slot 1 (external memory) | |
| RAM in slot 2 (external memory) | |
| RAM in slot 3 (external memory) | |
| Any RAM memory; ie 0, 1, 2, or 3. Used by CLI for temporary files, and lost on reset. | |
| ROM | |
| Screen | |
| Printer; via printer driver so that highlight codes are interpreted | |
| Communications; via serial port | |
| Standard input | |
| Standard output | |
| Null: absorbs output, and acts like an empty file on input |
Note: RAM . - files must be deleted before a soft reset is performed with Operating Systems up to and including 3.0.
Wildcards
The device, directory and file name can contain the following wildcards:
* | Matches any number of characters (or none) | |
? | Matches a single character | |
// | Matches any number of directories (or none) |
For example,
:*//letter | Finds the file called | |
doc* | Finds: doc. tx, document, doc27, doc , etc | |
*.* | Finds only files with extensions. | |
../fred | Finds all files beginning with fred in the parent directory |
Note that the characters / and \ may be used interchangeably.
Additional Filer commands
The following commands provide facilities for creating directories, manipulating files within the hierarchical directory structure, and executing files of commands. The files referenced by commands such as Select directory or Execute can be selected by marking them; (see Selecting files).
Sl | Select Directory | ||||||
Sets the current directory to the specified directory. Gives the prompt
displaying the current directory string (if any). For example; to set the current directory to directory
If the directory has not been created, a | |||||||
SV | Select Device | ||||||
Sets the current device. Gives a prompt such as
showing the current device, which can be edited to the required new device. The Select Device command resets the current directory to the root directory. The Select Device and Select Directory commands affect the device and directory for the activity from which the Filer was entered, if there is one. This allows different activities to use different devices and directories without the need for specifying them explicitly each time. Note, therefore, that if you save files having set a device and/or directory from one activity, and then enter the Filer from another activity, the files may not appear in the DIRECTORY list. Check the directory displayed at the top of the DIRECTORY window to ensure that you are in the intended directory. | |||||||
|
| ||||||
These commands are used for traversing a hierarchical directory structure. To select a directory move the highlight bar to the directory name in the Filer DIRECTORY window and press
SHIFT
. To go back up to the parent directory press
SHIFT
. | |||||||
EX | Execute | ||||||
Executes a CLI file of commands specified after the prompt
See CLI files below. | |||||||
CD | Create Directory | ||||||
Creates a directory within the current directory; the name is specified after the prompt
| |||||||
TC | Tree Copy | ||||||
Copies a file tree from one directory to another. Arguments to the S o u r c e and D e s t i n a t i o n fields must be devices or directories. For example,
will make a duplicate copy of all files from RAM card 1 to RAM card 2. The source area cannot be part of the destination area. | |||||||
NM | Name Match | ||||||
Sets up a match string restricting access to files in the current directory to those that match the string. For example, setting
Will catalogue only files with a |
CLI Files
The Filer Execute command,EX, allows a text file to be passed to the Command Line Interpreter, or CLI. The effect is as if the characters in the file had been typed at the Cambridge Z88 keyboard. CLI files thus provide a means of specifying a sequence of commands or operations, which can then be carried out simply by executing the file. For example, an execute file could be used to carry out a frequently-used sequence of Replace operations in PipeDream documents.
Note:
If a CLI file fails to be interpreted correctly, it may not have been written with PipeDream or tested.
To correct this,
- Load the file into PipeDream
- Remove any spaces that are at the start of each CLI command
- Save the file as a 'plain text' file.
This will correct the line feed character if it was different, at the end of each line.
Certain characters are given a special significance in CLI files, to allow special keys on the keyboard to be represented, or additional operations to be carried out by the Command Line Interpreter.
These special characters, and their functions, are as follows:
# | Prefixes a key sequence |
| | Prefixes a key sequence |
~ | Used in combination with a letter to represent other special keys on the Cambridge Z88 keyboard |
. | As the first character on a line, introduces a special CLI command. |
To represent these actual characters in a command file, they should be specified twice:
Sequence | Represents |
---|---|
## | # |
~~ | ~ |
|| | | |
Key sequences
Character | Significance |
---|---|
~A | Single press of the key; ~A~A has no effect |
~C | Single press of the key; ~C~C has no effect |
~S |
SHIFT
|
~I |
INDEX
|
~M |
MENU
|
~H |
HELP
|
~E |
ENTER
|
~X |
DEL
|
~T |
TAB
|
~U | |
~D | |
~L | |
~R | |
|[ |
ESC
|
File control commands
The full-stop character introduces the following special commands when it is the first character of a line in an execute file.
Sequence | Significance |
---|---|
.T> filename | Create output file |
.T< filename | Create input file |
.T= filename | Create printer file |
.> filename | Redirect output |
.< filename | Redirect input |
.= filename | Redirect printer |
.D nnn | Delay nnn centiseconds |
.S | Suspend CLI; all redirections of input or output remain in force |
.* filename | Invoke new file to CLI |
.J | Ignore special significance of subsequent escape characters |
a comment | Ignored. |
The T character represents a 'T' junction, as it causes an additional copy of the input or output to be sent to a specified stream. For example:
.T> :RAM.0/fred.txt
sends a copy of what is going to the screen to the file
:RAM.0/fred.txt
The J character stands for 'Jam', as it inhibits interpretation of the escape characters.
Printer output can be spooled to a file with the '=' symbol. For example,
.= :RAM.0/printout
takes the text that would have been printed out, before printer codes are added, and puts the text into the file
:RAM.0/printout
Terminating execute files
When the CLI is running an execute file a CLI symbol is displayed in the OZ area of the screen. The current CLI can be terminated by pressing
Redirecting keyboard input and screen output
The following key combinations can be used to redirect keyboard input and screen output:
Key | Effect |
---|---|
+P | All screen output also sent to the printer |
+S | All screen output also sent to the file : RAM .-/S.sgn |
+K | Key input also sent to the file : RAM .-/K.sgn |
For example, +P can be used to obtain a catalogue of EPROM or RAM to a printer.
The corresponding sequences with `–' turn the facility off, and sequences +P and +S are mutually exclusive.
The commands +S and +K generate files K.sgn and S.sgn in temporary RAM. These should be deleted after use with the Filer Erase command.
Editing BASIC programs using PipeDream
BASIC programs are saved in a tokenised format, and so cannot be loaded into PipeDream and edited directly. However, the CLI provides a convenient way of obtaining a text listing of a BASIC program, which can then be edited and executed back into BASIC.
The procedure is as follows:
- LIST the program to the file :RAM.-/S.sgn by typing
LIST +S
[ENTER]
- When the listing has finished, close the file by typing
-S
The file:RAM.-/S.sgn
can be loaded into PipeDream as plain text, and edited. - Add the characters
.JNEW
at the start of the file, and save it from PipeDream using the Plain text option. - Execute the edited file back into BASIC by entering BASIC and typing:
*CLI .*FILENAME
to invoke the CLI to execute the file. - When finished, erase the file
:RAM.-/S.sgn
using the Filer.
The . J at the start of the file avoids the need to replace characters such as # by ## throughout the BASIC program so that they will not be interpreted by the CLI.
Executing a file on reset
On resetting the Cambridge Z88, if a file with the name
BOOT.CLI
exists on an EPROM card in slot 3, it will be copied into
:RAM.-/BOOT.CLI
and then executed. The file should be deleted when it is no longer required.