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:

.sgn

For +K and +S CLI files

.CLI

For BOOT.CLI; see CLI files, p. 173.

.L

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:

../nameParent directory of name
.Current directory

Device specifications

DEVICE can be specified as one of the following:

SpecificationEffect
:RAM.0 RAM in slot 0 (internal memory)

:RAM.1

 

RAM in slot 1 (external memory)

:RAM.2

 

RAM in slot 2 (external memory)

:RAM.3

 

RAM in slot 3 (external memory)

:RAM.-

 

Any RAM memory; ie 0, 1, 2, or 3. Used by CLI for temporary files, and lost on reset.

:ROM.0

 

ROM

:SCR.0

 

Screen

:PRT.0

 

Printer; via printer driver so that highlight codes are interpreted

:COM.0

 

Communications; via serial port

:INP.0

 

Standard input

:OUT.0

 

Standard output

:NUL.0

 

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 letter anywhere

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

Name :

displaying the current directory string (if any).

For example; to set the current directory to directory TEXT in the current directory, specify

Name : TEXT

If the directory has not been created, a File not found error will be displayed.

SV

Select Device

 

Sets the current device. Gives a prompt such as

Name : :RAM.0

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.

SHIFT

SHIFT

Down Directory
Up 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

Name : I

See CLI files below.

CD

Create Directory

 

Creates a directory within the current directory; the name is specified after the prompt

Name : I

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,

Source ::RAM.1
Destination ::RAM.2

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

Name : *.bas

Will catalogue only files with a bas extension. The default match string is *, matching all file names. When a name match other than * is active, the symbol NM will be displayed at the left-hand end of the Filer DIRECTORY window

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,

  1. Load the file into PipeDream 
  2. Remove any spaces that are at the start of each CLI command
  3. 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:

SequenceRepresents
###
~~~
|||

Key sequences

CharacterSignificance
~ASingle press of the key; ~A~A has no effect
~CSingle 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.

SequenceSignificance
.T> filenameCreate output file
.T< filenameCreate input file
.T= filenameCreate printer file
.> filenameRedirect output
.< filenameRedirect input
.= filenameRedirect printer
.D nnnDelay nnn centiseconds
.SSuspend 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 commentIgnored.

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 

SHIFT
ESC
. If several CLIs are running they can all be terminated by holding down  and pressing 
ESC
.


Redirecting keyboard input and screen output

The following key combinations can be used to redirect keyboard input and screen output:

Key   

Effect
+PAll screen output also sent to the printer
+SAll screen output also sent to the file : RAM .-/S.sgn
+KKey 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:

  1. LIST the program to the file :RAM.-/S.sgn by typing LIST +S [ENTER]

  2. 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.

  3. Add the characters
    .J
    NEW

    at the start of the file, and save it from PipeDream using the Plain text option.

  4. Execute the edited file back into BASIC by entering BASIC and typing:
    *CLI .*FILENAME


    to invoke the CLI to execute the file.

  5. 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.

web analytics