%OP%PL72
%OP%LM7
%OP%HE///@T@
%OP%FO//@P@//
%OP%DESVETODSK.DOC
%CO:A,12,72%%C%%H2%SAVE-TO-DISK

%C%Version January 93

%C%Filename: SVETODSK.193

%C%(193 =Jan 93)

%H2%SAVE-TO-DISK January 1993%H2% is a programme which will select files saved 
in Z88 RAM today, and transfer them via RANGERDISK to disk.

Remember that RANGERDISK requires at least 128k RAM in slot 1 in order 
to work.

%H2%SAVE-TO DISK JANUARY 1993%H2% is the first of a project aiming to permit 
the whole of the Z88's file structure and contents to be saved to a 
DISK DRIVE; and may eventually include a system which will restore the 
whole directory structure and files, as loaded from disk to the 
Z88.  This might be required, for example, after a hard reset.

%H2%SAVE-TO-DISK%H2% is a concept which has been developed and written by 
Richard Boam, of The Old Post Office, Rusness, Sanday, Orknay, (for 
use with XOB diskdrive) and has been adapted (as SVETODSK.193) for use 
with RANGERDISK by Philip Hodson of 40 New Cheveley Road, Newmarket 
Suffolk.

SAVE-TO-DISK chains Z199C - LISTCOMP.BAS which compiles lists of 
directory files into Pipedream (and is also by Richard Boam). Z199C may 
be in any directory of the DEVICE.

If you do not wish SAVE-TO-DISK to use the name LISTCOMP.BAS, use the 
command >LIST IF Z199C to find each reference to it in SAVE-TO-DISK and 
edit the expression accordingly.  

%H2%RUNning SAVE-TO-DISK.

To work correctly, where a sub-directory of the Z88 is specified by the 
operator, a directory of the same name must exist on disk.  If it does 
not exist, you must create it before you run SAVE-TO-DISK.

Where a sub-directory does not exist on disk, Rangerdisk will cause the 
saving operation to "hang". The operator will need to press ESC to 
release RANGERDISK, and then <>ESC to stop the CLI. Because Rangerdisk 
takes several seconds to complete its own operation after ESC is 
pressed, it is not possible to cancel the CLI immediately, and because 
the CLI is running Rangerdisk, the CLI will start it up again just 
after Rangerdisk has stopped.  So deselect the CLI as soon as the disk 
stops spinning for a moment.  If the CLI is not cancelled, it will 
continue to run and will create a SAVE REPORT in Pipedream which claims 
that a SAVE of files listed has been made, when in fact this is not the 
case.

On one occasion, following an error of not creating a disk directory, 
I allowed the CLI to continue, pressed []ZD from SAVEREPORT and the 
system crashed, requiring a soft reset.  So the moral is, ensure you 
have directories on disk which SAVE-TO-DISK can select!

%P0%
SAVEREPORT is a Pipedream appendage to SAVE-TO-DISK which works by 
loading the contents of a temporary file called CAT-RAM.L. CAT-RAM.L 
contains the list of files to be saved.  The saving operation can go 
wrong, a) where a disk directory is not created, or is inaccessible; b) 
where the cursor in Rangerdisk is not over CATALOGUE DISK at the start.

This second error causes errors of the tagging of files for saving.

For tagging to occur properly (that is the positioning of the little 
triangle which selects files for saving using TAB), Rangerdisk must 
start with the cursor in the left hand window over CATALOGUE DISK <>DD.
If the cursor is not over CATALOGUE DISK it will move to the right and 
tag the wrong files for saving. SAVEREPORT will then be inaccurate.

Each time a new instantiation of Rangerdisk is made the cursor will be 
in the correct position, but if the operator has been using Rangerdisk 
previously, he must make sure that the cursor is correctly positioned 
before proceeding with SAVE-TO-DISK.

In these notes, the term "root directory" refers to a directory on 
disk "at the same level" of the directory tree as :RAM.0, 1 or 2 etc.

Contents of a DEVICE i.e :RAM.1 or :RAM.2 etc may be saved directly 
onto disk, (without any directory on disk).  Conversely a root 
directory may exist into which a SAVE may be made.

Rangerdisk will not support a directory named :RAM.0 or :RAM.1, so a 
root directory must be named something else. I always date my root 
directory to give an indication of when the disk was started.  So my 
root directory is currently called WEFJAN93 (With Effect From January 
1993), all other files/ directories being within that.

The RANGERDISK USER GUIDE section 4.4.12 page 11 advises the creation 
of root directories because only 112 files or directories can be saved 
at the level of the root directory; whereas within any one directory, 
the number of files is limitless, subject only to disk space.

For this reason it is assumed that most Rangerdisk users create at 
least one root directory into which are stored all files and 
sub-directories.

SAVE-TO-DISK will always select a lone root directory without the user 
having to specify its name, but if you have other files/
sub-directories at the same level as the root directory, then you must 
specify the root directory you want at the prompt:-
  
   If none or 1 root directory, press ENTER; if more than 1 enter root 
   directory name :

SAVE-TO-DISK is designed to save TODAYs files in any  one directory 
chosen by the operator.  Like Cinderella who had to be home before 
midnight, so must the programme be finished by then, otherwise today's 
files become yesterdays and are not saved!  You can however set the 
computer clock back if you believe that you will run out of time.

%P0%
During operation five temporary files are made in :RAM.0. SAVE-TO-DISK 
creates and deletes CAT.L, CAT-RAM.L and ZD.CLI.  LISTCOMP.BAS creates 
and deletes E.cli and F.cli.  The SAVE-TO-DISK files cannot be deleted 
before the save is instigated, so they are transferred to disk when
:RAM.0 is selected.

If it is important that they do not appear on Disk the following is 
available:
1) Delete them manually from disk after the save.
2) Collect all the files you want saved in a different device or 
   directory to :RAM.0.
3) Reconfigure LISTCOMP.BAS and SAVE-TO-DISK so that the temporary 
   files are created in :RAM.- or another device.  Personally I never 
   feel happy about the stability of :RAM.-; that may be because I 
   don't use it enough; it should be fine as long as files are deleted 
   after use, as they are in this programme.

If you wish to reconfigure, change :RAM.0 to :RAM.- at the following 
lines:

In SAVE-TO-DISK: lines 340, 350, 360,1280
In LISTCOMP.BAS: lines 1730, 1880, 1990, 2380, 2390, 2530

It is best to use Z007A BASIC PATCH in order to obtain the *EDIT 
function, so as to minimise rewriting lines.

SAVE-TO-DISK is written so as to allow other instantiations of BASIC 
and Pipedream in the INDEX applications while it functions. However, 
particulary where the CLI of SAVE-TO-DISK was stopped in mid-stream, a 
couple of soft resets were required during programme development.  On 
that basis it is wise to ensure a file copy exists of everything in the 
applications list.

I hope you like this programme, it has taken Richard, with his 
considerable skills many hours of development, and myself, with much 
less understanding a good many late nights.  Tell us how you like it!

Happy saving!

Philip Hodson.
%CO:B,12,60%%CO:C,12,48%%CO:D,12,36%%CO:E,12,24%%CO:F,12,12%