
	This is the instructions and overview of Sv2dsk.zip	

	This was written by Charles Cohen, and is meant for personnal use.
	
	To contact: Charles Cohen
				CIS # 71674,3113
				1124 Woodstock Ave.
				Victoria, B.C.
				Canada.  V8V 2R1
				604-383-7809
				
	This program is posted as Freeware and is used at your own risk.

	I would like to thank Richard Lam for Vrexx2 and Dion Gillard for Rxextras,
for adding an incredible amount of utility to REXX.	Also Rick Fishman for 
Procs.exe and Killem.exe, Very usefull in programming with Rexx. And lastly, my
friend Flynn Marr for being on the other end of the phone line whenever needed.

	For use with OS2 2.* and Rexx
	
	Tested on FAT based systems. I have not tested it on HPFS.(it should work).
	I have run it through its paces and have found it to be extremely well-
	behaved.  It was programmed and tested on a Toshiba 6400DX with one
	floppy and one hard drive. 

	The purpose of Sav2disk is to be able to save only newer files to a floppy
disk (either A:\ or B:\ drives). Being without any tape drives or multiple hard
disks to store my constantly changing DATA files using commercially avaialble
software, I designed Sav2disk.cmd to seek out a previously specified source 
directory and compare it too a previously specified target disk and directory.
I check each file in the source directory too its' counterpart on the target 
disk (and/or directory)	and determine just what to do with it.  This is
repeated until all the files in the source dir have been compared and/or copied.
Obviously if the files are new, I don't check and simply copy them to the disk.
You can modify your choices from within the program, can view a log of the
failed, cancelled or comleted saves, and I included a viewing utility of A: or
B: drive, so you can see what is on the disk before choosing to copy the files.
Sav2disk works with 360k, 720k, 1.4Meg, and 1.2Meg FORMATTED disks. I added the
multiple disk feature on a lark. It wasn't so larky afterall but its done. I
actually keep my DATA directories in separate directories from their programs
and try to keep them below the size of my disk drive, ie: 1.4Meg in my case.
Sav2disk was really meant for this purpose.  The files are stored uncompressed,
just as they appear on the Hard Drive. to restore a files or files use the OS2
Disk Utilities or any other suitable file copy routine.  If there is enough
interest, I guess I'll write Rstr2dsk.cmd.
	
	Please feel free to contact me if you have any problems ...or not. Feedback
is a wonderfull thing.

	If you desire a copy of the .cmd file with line-by-line annotation, contact
me and I will either mail you a printout or Email you the file on Compuserve.
Given the original is 78000k the text file should be quite a bit larger.
Actually I haven't done it yet, so I don't know the exact size. Because the
.cmd file is  about 2500 lines, I will wait until prodded to produce it.  I do
appreciate the difficulty of following someone else's programming, so I tried
to keep my variable names obvious. However, this will not be enough in all the
different routines I run.  So do feel free to ask for the annotated text.

*-----------------------------------------------------------------------------*

Installation of Sav2disk

Make a directory on whichever drive you wish your own choosing. ie:SAVEDATA
Copy Sav2disk.zip to that directory and unzip it.
Make sure all the files mentioned below are there.
Open the Template Folder and drag a Program Template onto the desktop
Open a Program Template, and in the Path and Filename Box type
	 the full drive and path and Sav2disk.cmd. ie: D:\SAVEDATA\SAV2DISK.CMD
In the Working Directory Boxtype the full drive and path. ie: D:\SAVEDATA
This will insure that Sav2disk is in its own directory and path enviroment.
Click on Session tab, and at the top right are two boxes.
     One says Start Minimized and the other says Close Window on Exit.
     Click both of these on. (checkmark in the box).
Next click on General tab and in the Title Box. Type Save to Disk. 
     If you ever do call up this window to the desktop,
     this is a nicer name to see on the title bar.
     It will also then appear as the name running in the Window List.
I have included Sav2disk.ico if you wish to change the icon.
     Click on Find, then Locate, then Path tabs
     and type in the directory where Sav2disk.ico is.
     The Sav2disk.ico will be displayed.
     Choose and Save icon, then leave the folder. 

It's done.  Double click on the icon at you should get Sav2disk
screen, which says 'Select a group to Save'. To setup Sav2disk for your
own directories, read Setting Up Sav2disk (below) under Explanation of
Sav2disk. 

You can have more than one copy of Sav2disk loaded on your computer at a time.
They must be in separate directories, unique from each other.  You may keep
all the files in each directory or because YOU MAY ONLY RUN ONE Sav2disk AT A
TIME, Vrexx.exe can be copied to C:\OS2 and all the .dll files to C:\OS2\DLL.
You can run only one Sav2disk at a time because Rexx, Vrexx and Rxextras will
try to share common information.  OS2 will stop you if you attempt this.




*-----------------------------------------------------------------------------*

Contents:

Sav2disk.zip - unzipped it contains 16 files which are:

			 - S2dinstl.txt - contents, install instructions, usage information
			 - Sav2disk.cmd - program for saving newer files only, from
			 				  specified directories, to specified directories
			 				  (read below for full description)
			 - S2d.tmp      - 0 byte file, used in Sav2disk.cmd to test drive
			                  readiness, if you wish to copy this file to disk,
			                  you must use XCOPY (COPY cannot copy a 0 byte
			                  file)
			 - S2dsetup.fil - Ascii file containing information that is used
			                  by Sav2disk.cmd to store your particular choices
			                  and the directories associated with them. The 
			                  " ` " at the beginning of each line are necassary
			                  for Sav2disk to extract the information properly.
			                  Sav2disk has a routine to edit this file from
			                  within the program.
			 - S2dsetup.str - copy of the above file with initial settings for
			                  Sav2disk.cmd. For safety only.
			 - S2dlog.fil   - Log file with opening line. Can be erased anytime
			                  as Sav2disk.cmd will create it if it is not there
			                  when you do a backup.
			 - Sav2disk.ico - icon for this program
			 - Vrexx.exe,Vrexx.dll - files needed by the of program to generate
			  	 & Devbase.dll       PM windows etc.. it is part of the VREXX2
			  	w/ Licence.txt       utility. The complete VREXX2 program is 
			  						 available as VREXX2.ZIP in either OS2USER
			  						 or OS2SUPPORT forums on Compuserve. It is
			  						 Freeware and adds quite a few interesting
			  						 additions to REXX. The complete package
			  						 includes .inf files for documentation and
			  						 example files.
			 - RxExtras.dll        - file needed by the program to accomplish
			                         certain events...it is part of RxExtras
			                         utility. The complete RxExtras program is
			                         available as Rexxtr.ZIP in OS2DF1 forum
			                         on Compuserve. It is Shareware and adds 
			                         some very usefull routines and functions
			                         to REXX. The complete package includes
			                         .inf files for documentation, .API files
			                         for use with VisoProRex and\or VX-REXX,
			                         and example files.	You are allowed to have
			                         what I have included but you are not
			                         allowed to distribute or use it in your own
			                         programs without registering it first.
*-----------------------------------------------------------------------------*

	These foloowing programs were written by Rick Fishman of Code Blazers Inc.
	There was no licencing information or referred to in his documentation, so
	I included them along with their .doc file. These represent the total .zip
	files that I found on Compuserve and the .doc includes the information
	regarding the author etc..  If you intend on playing with Vrexx and/or Rexx
	these are necessary tools for extricating yourself from pretty intense
	situations. Thanks Rick.
		
		 - Procs.exe  - Utility which identifies PID (process ID number)
		 				and reports all that is using the operating
		 				system. Usefull when programming using Vrexx2
		 				and/or Sav2disk.cmd.
		 - Killem.exe - if you are going to experiment with Vrexx2 and/or
		                alter Sav2disk.cmd, this file will be indispensible.
		                Also if for any reason Sav2disk lockups the computer
		                killem can be used to free up the system without
		                rebooting
		 - Killem.doc & Procs.doc - readme files for above executables
			 
    N.B. - To identify process, open an OS2 window and from the directory that 
           contains Procs.exe, and at the prompt type, Procs.  You can then 
           Killem PID# or Killem Vrexx, to release Vrexx from the operating
           system. You can type Killem Vrexx without running Procs first.  If
           there is nothing wrong, nothing will happen.  Use these carefully.
           I copied them from OS2user or OS2support forum on Compuserve.
           As Procs2.zip and Killm21.zip.

*-----------------------------------------------------------------------------*

Explanation of Sav2disk.cmd

 /* PLEASE USE FORMATTED DISKETTES ONLY */
 
The first screen produced has 12 choices. You may choose any one of the twelve.
Upon startup it is advisable to use 'Setup/Viewing Tools' then 'Modify Sav2disk'
to set up the program since selection 2 through 11 will simply loop because
Unused Choice 1 - 10 are not presently configured. 'Pick a File..' will work
but please read below on 'How it Works ?' before you try it.

1) 'Setup/Viewing Tools'
	This utility creates a window of four more choices.
	1) View Sav2disk Log: As Sav2disk is used, it stores the date, time and
	                      choice to S2dlog.fil when begun & cancelled or ended.
	                      It also contains the names of any files that were not 
	                      copied correctly when the save was done.  It is an
	                      Ascii file that can be read by any editor (such as
	                      E.exe). The viewer only displays the last 18 lines of the
	                      file. If you delete it, Sav2disk will create it again
	                      the next time you run the program. If no log file is
	                      present, the viewer will inform you.
	2) View A:\ - Drive : This utility allows you to view what is on A:\ Drive.
	                      It is only a viewer, no writing to disk occurs.
	3) View B:\ - Drive : This utility allows you to view what is on B:\ Drive.
	                      It is only a viewer, no writing to disk occurs.
	4) Modify Sav2disk  : Please see below for explanation, concerning Setting
	                      Up Sav2disk.
Setting Up Sav2disk:

	Modify Sav2disk creates a window of 10 choices.  These refer to the 'Unused
Choice 1 through 10'. You can choose one or more to edit at one time.  You will
then be prompted to 'Enter new Title for', that can be no more than 21
characters in length and consist of no more than 4 words. It does no matter if
you use capitals or not. Sav2disk will capitalize the first letter of each word
and lower case the rest of the word.  You can only use A to Z as valid title
characters. Because Vrexx2 use scalable fonts for displaying characters, the 
Title, depending on which letters were chosen (ie: w take up more space that i)
title my still be too large for the initial window.  The program still operates
properly, but doesn't look very nice.  You will only see this after you have 
saved the entry(s). Try it again. You will then be prompted to 'Enter a Source
Dir for', in the form of Drive:\Path\*.* (ie: D:\Dbase\Garden\*.src). As you can
see, you can use wildcards (*) with specified extensions, or you can use
E:\*.* or any string that is in that form.  If no files are pointed to (ie: the
entry looks like this, D:\Dbase\Garden) the program will tell you that
the source directory entry is NOT VALID and disallows the save.  Try again.
If you write the source directory properly but it does not exist Sav2disk will
tell you that No Files were found when Sav2disk tries its first save of that
directory. This is also case insensitive. Sav2disk will capitalize all 
characters.  If Sav2disk is editing 'Unused Choice 1 through Unused Choice 9',
you will then be prompted to 'Enter a Target Directory for'.  You may use A
to Z or 0 thru 9 as cahracters. This entry only needs a name, ie: GARDEN would
be used as a target directory such as A:\Garden, and the files would be copied
to A:\Garden.  The sub-directory need not have been created on the target disk.
Sav2disk will create it if it does not exist. If you want to use the root of 
either A:\ or B:\ drive, simply leave this entry blank. This is also case
insensitive.  Sav2disk will capitalize the characters. If Sav2disk was editing
'Unused Choice 10' there will be only 'Enter a Source Directory for'. Choice 10
is an XCOPY routine that requires only a Source directory. XCOPY as I run it,
will copy all the files and sub-directories and their files to the floppy of
choice.  I have included this for a couple of reasons. Firstly it copies much
faster than COPY and will copy all sub-directories and their files, creating
the sub-directories if they don't exist, on the target drive.  The second
reason is the Workplace Shell Backup program I use, makes 2 sub-directories
and writes 40 files to them.  When I want to copy them from my hard disk to 
floppy, I know that all of them (the files) in all their sub-directories, have
been changed, so Sav2disk doesn't bother to check which of the two files, the 
source directory file or target directory file is newer.  This Choice is
limited to the space avaialbale on one disk. Sav2disk does take into account
if the target directories and subdirectories & files are on the target disk
before it copies.  It will not copy more than one diskfull of any size.  
Restoring my Desktop requires that all the files are on only one disk.
After you complete the three (or two as in the case of 'Unused Choice 10')
entries for each of your choices you will be prompted to Save the Settings.
Answering YES will save the choices you have just done and the program will
continue with your choices if there are more than one.  Answering NO and the
programs does not save the last	choices but will continue with your other 
choices of there are any.  When you are all done, you will be returned to the
beginning screen and the 12 choices with your new menu. (all except Setup/
Viewing Tools and the last choice 'Pick a File..')

2) How they work ?
 
	'Unused Choice 1' - 'Unused Choice 9' inclusive. 

I first allow you to select which disk drive (A:\ or B:\ drive) you wish to
copy too. You can also decide to delete all files, directories and
sub-directories on the target disk by choosing TOTAL DISK SPACE on the
appropriate drive. If this is choosen the disk is cleaned but not formatted,
by the deletion routine.  The files are then copied from the source directory
to the chosen disk one by one. If you fill up the disk, Sav2disk will ask you
insert another disk in the drive.  You can even switch drives size if
you want.  You will again be given the choice use TOTAL DISK SPACE on the new 
disk. If you choose CHOSEN DIR ONLY, Sav2disk will then use only the space
available in that directory. ie: if your target directory is  A:\S2DBKP, 
Sav2disk will make room only in that particular directory by deleting files,
when necessary, that do not appear in the source directory  ie: if your
target directory is simply, A:\ or B:\ (the default directory is the root),
Sav2disk will not use any space on the target disk addressed by another
sub-directory. If there is room on the disk to copy without deleting, that
will be done first before any deleting takes place.

If the file exists on the target drive and is older than the on in the source
directory, I copy it. If not I continue on to the next file in the source
directory. If the file is new, I copy it. If there is no room to copy to the
target drive and/or directory and there are other files existing on the target
drive (in the directory chosen if not the root directory) which do not exist in
the source directory, they will be erased as needed to make room for the files
which chosen. If there are no other files to erase to make room on the target
drive, the program prompts for a new disk to use.  There is protection for 
choosing a drive which does not physically exist. ie: B:\drive on a laptop
Sav2disk does not allow the OS2 operating system to change the drive 
designation by asking for it twice, as would occur from a OS2 prompt. If the
disk that is chosen to copy too, is write-protected, OS2 will come up with its
own Error Box.  The Error is explained and 3 choices are given. 1) RETURN ERROR
CODE AND RETURN TO THE PROGRAM, will, if the Tab is changed, allow the program
to continue happily on its way; if the Tab is not changed Sav2disk.cmd will err
and produce its own Error window. Under these circumstances these errors will
continue to alternate until the Tab is changed to allow for a copy. 2) END
PROGRAM,  will end Sav2disk.cmd and return you to the OS2 Desktop. 3) REDO
COMMAND, will, if the Tab is not changed, will keep displaying the same OS2
Error Box.  Once the Tab is changed the program will continue happily on its
way. All other errors, such as the file is larger than the total disk size, no
files found in the source directory, a directory such as C: or D: or anything
that Sav2disk will not recognize as a directory to search, are caught and you
will be informed by Sav2disk. Even a full FAT table error is caught. (112 files
in a root directory of a 720k disk).

3) How it works ?

	'Unused Choice 10' has been explained above in Setting up Sav2disk.

4) How it works ?

	'Pick a File to Save'

	This routine will copy a single file to your target disk. It will not allow
	copying from either floppy to each other or themselves.  It also searchs 
	the path you have either written or chosen, to make sure the file exists
	before it tries to copy it.  It will delete files in the root directory of 
	the target diskette when necessary to create space for the file chosen, if
	you had chosen CHOSEN DIR ONLY. You may also choose the TOTAL DISK SPACE
	to clean up the diskette before copying.  If their is no room on the
	diskette, you will be prompted for a new one. This NEW DISK ROUTINE is 
	explained above in 'Unused Choice..' If the file chosen is larger than the
	disk size, you will be informed.

5) How it works ?
	
	S2dlog.fil - this is a simple Ascii file ie: no printing format included
	             you may edit it in any Ascii Text Editor (E.exe) to remove
	             excess lines or whatever you wish to do.  Sav2disk lets you
	             view only the last 18 lines when you ask for this utility.
	             If you have deleted the file, you will obviously be unable to
	             view it. Sav2disk will create a new S2dlog.fil when the 
	             program is used next.
	             
6) How it works ?

	S2dsetup.fil - this is an Ascii file that contains the 29 lines which
	               Sav2disk uses to determine the titles, source directories
	               and target directories of your choices.  You may edit it
	               outside of Sav2disk but be sure to leave ' ` ' at the
	               beginning of each line (this symbol on my keyboard is
	               on the same key as ~).  Sav2disk requires this mark so that
	               blank lines can be read by Sav2disk when reading from this
	               file.  Lines 1, 3, 5...are the titles of Choice 1 through
	               Choice 10; Lines 2, 5, 8....are the source directories for
	               their respective titles; Lines 3, 6, 9...are the target
	               directories associated with their respective titles and
	               source directories.
	       		   I included S2dsetup.str. It is a copy of the original
	       		   file (Unused Choices) and can be renamed S2dsetup.fil
	       		   and used to begin again.
7) How it works ?

	S2d.tmp - this is a zero-byte file that is used by Sav2disk to check if the
	          write protect-tab is set.  It will only fail is the tab is set or
	          the FAT Table is full.  It will copy even if the disk is 
	          apparently full.  If you want a copy this file to floppy, you
	          must use XCOPY.  COPY will fail on a zero-byte file.
	          	       		   
*-----------------------------------------------------------------------------*
	
			                          
			                          
			                  
