9540
External Specification
CPMCOPY
9540 Utility to Read 9520 CP/M Diskettes
6-17-83
1
1. INTRODUCTION
1.1. PURPOSE OF THIS DOCUMENT
The purpose of this document is to discuss the user interface,
limitations, and features of a program to copy files from diske-
ttes created on a CP/M system to the 9540 system.
1.2. PURPOSE OF THE PROGRAM
The purpose of the utility program is to transfer files from any
diskette which was created on a 9520 or 9516S system (CP/M or
MP/M) to the 9540 system. In addition, it is capable of
reading a Standard, single-sided, single-density, eight inch
diskette which was created on any Version 2.x CP/M or Version
1.y MP/M system. With respect to the 9520, it is capable of
reading any of the following diskettes:
Standard 8" Single-sided, Single Density
9520 8" Single-sided, Double Density
9520 8" Double-sided, Double Density
1.3. SYNTAX CONVENTIONS
The string <cr> will be used to denote a carriage return.
Square brackets ( [ ] ) are used to indicate optional
parameters. Thus
command [hex-number] <cr>
indicates that the "hex-number" parameter is optional.
For the purposes of this utility, a CP/M file-identification
(file-id) will consist of
an optional user-number in the range 0-F, inclusive.
a one to eight character file-name.
an optional one to three character file-type.
and will be denoted by
[(u)]fn[.ft]
The string "[(u)]" indicates the the user-number "(u)" is
optional. The string "fn" indicates that the file-name is not
optional if any portion of the file-id is specified. The string
"[.ft]" indicates that the file-type is optional. Examples of
CP/M file-ids are:
(0)MYFILE.SRC
(F)M1234567.123
MYFILE.SRC
2
MYFILE.S1
MYFILE.S2
M
All of these are examples of Unambiguous file-ids. In the CP/M
system, there are two "wild-card" characters which are used to
specifiy an Ambiguous file-id. The question mark "?" is used to
replace a single character and indicates that any character is
valid in that position. The asterisk "*" is used to replace
groups of characters. For example, if the CP/M disk contained
the files mentioned above, then the string "MYFILE.S?"
would represent
MYFILE.S1
MYFILE.S2
whereas the string "MYFILE.S*" would represent
MYFILE.S1
MYFILE.S2
MYFILE.SRC
The phrase "file-id" will be used to represent an ambiguous or
unambiguous CP/M file-id.
3
2. COMMAND SYNTAX
The command format is:
cpmcopy [-t] [fileid]
where
-t indicates that no translation is to be done. This
option is used to copy object or binary data files.
The default is to perform the following translations:
0D0A --> 0A
1A indicates End-of-File
Bit 7 is set to 0 for all characters
The default is used to copy source files or ASCII
data files.
'file-id' is the CP/M file identification which was described
above. If this parameter is not given, the default
file-id is:
any user number
any file-name
any file-type
If this parameter is passed, but only the file-name
is specified, the the user-number defaults to "0",
and the file-type defaults to all space characters.
The wildcard characters "*" and "?" can be used in
the file-id and have the same meaning as they do for
CP/M.
Note that the file-id must be enclosed in single
quotes. This is especially true if the file-id con-
tains any metacharacters which have meaning to the
9540 shell.
Note also that the file-id can be typed in upper or
lower case, or a mixture of cases. All characters
are converted to upper case before searching for a
valid CP/M file.
When the copy command is given, the diskette should already be in the
disk drive. After the command is given, CPMCOPY will attempt to
determine the number of sides and density of the diskette. Then it
will transfer all files which match the specified file-id from the
CP/M diskette to the current 9540 working directory. For each file
which is transferred, the CP/M user-number, file-name, and file-type
are used to construct the 9540 path-name. For example, suppose that
4
the CP/M diskette has the following file which matches the designated
file-id
user-number = 0
file-name = "MAIN"
file-type = "SRC"
On the 9540 system, suppose that the working directory is
/usr/clay
Then the file would be copied to
/usr/clay/main.src
On the other hand, suppose that the CP/M file was
user-number = 8
file-name = "MAIN"
file-type = " "
Then the corresponding 9540 path-name would be
/usr/clay/main8
that is, if the user-number is different from zero, then the user-
number will be appended to the file-name before the file-type is
appended. Note also, that the file-type is not appended if it is blank.
After all the specified files have been transferred, the program will
return to the 9540 shell.
3. SPECIAL KEYS
The user can abort the program by typing a Control_C.
4. ERRORS AND ACTION-ON-ERRORS
Errors are classified as follows:
COMMAND SYNTAX
COMMAND EXECUTION
NON-FATAL
FATAL
In all cases, an error is displayed.
Whenever a command syntax error is detected, control will return to
the 9540 shell.
Whenever a non-fatal error is detected, the program will attempt to
continue with the current function. An example of a non-terminal
error is a read error for a file data record on the CP/M diskette.
Whenever a fatal error is detected, the program will terminate itself
5
and return control to the 9540 OS. A write error for a output file
is an example of a fatal error.
COMMAND SYNTAX ERRORS
The message
Invalid parameter 'parm'
Usage: cpmcopy [-t] [file-id]
is displayed, where "parm" is the invalid parameter which was
passed by the user.
COMMAND EXECUTION - FATAL ERRORS
If the cpmcopy program cannot open the floppy disk device, it will
display the message
Unable to open floppy device ' name '
This should be defined as a character special file.
where "name" is the name of the floppy device file; the default is
/dev/rfd00 which has to exist and is defined as a character special
file.
If the cpmcopy program cannot identify the type of diskette, then
it displays the message
Disk type = UNKNOWN
If the cpmcopy program detects a read error while trying to read
the directory portion of the diskette, it displays the message
Directory read error
If the cpmcopy program detects an error while opening, writing, or
closing the 9540 file, it will display one of these messages
Error in opening output file. Pathname='name'
Error in writing output file. Pathname='name'
Error in closing output file. Pathname='name'
COMMAND EXECUTION - WARNING
If the cpmcopy program detects an error while trying to read a data
record from the CP/M file, it will display the message
Error in reading CP/M file
It will then write whatever data has been accumulated in its input
buffer to the output file. It is the user's responsibility to retry
the file copy or to clean up the output file. This feature can be
used to read files whose data has been partially corrupted.
5. EXAMPLES
The command
6
cpmcopy
will copy all of the files for all users from the CP/M diskette to
corresponding 9540 files. Translation will be performed, and the
default floppy disk drive will be used.
The command
cpmcopy -t '*.obj'
will copy all files for user=0, with any file-name and a file-type of
"obj". Note that the file-id can be typed with upper or lower case
characters since the program converts them to upper case before
searching for the file. In the same manner, when it is creating the
9540 pathname, all characters will be converted to lower case.
The command
cpmcopy '(5)test.c'
will search for a file belonging to user=5, file-name="TEST", and
file-type="C". It will copy it to a 9540 file in the current working
directory with a pathname of "test5.c".
6. NOTES, WILD CLAIMS, DISCLAIMERS, AND RANDOM MUMBLINGS
Under CP/M, using random access, it is possible to create files which
have "holes" in them. For example, if a file were created, and only
records 0 and 8000 were written, then the disk directory would
contain two extents. The first extent would have one block allocated
to it and that block would contain record 0. The second extent would
also have one block allocated to it and that block would contain
record 8000. No space would be allocated for the missing extents or
data records. The cpmcopy program will not correctly copy a file
which has "holes" in it. When it detects the first unallocated block
or extent, it will treat this as an End-of-File condition and close
the 9540 file. In the case above, only record 0 would be copied.
7