Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-04 - 43,50334/tops10.gno
There are no other files named tops10.gno in the archive.
%switch qz false
%if qz
%nocontrolc
%nextlesson pub("TOPQ");
%ifend qz
%text
Monitor commands for file handling.
==================================

When you are communicating with the monitor, there is a large
set of monitor commands which you can write in answer to the
dot (".") which tells you that the monitor is expecting
a command from you.

You have already in previous lessons learnt the following commands:

.LOGIN to get access to the computer,
.R to execute a system program,
.RUN to execute one of you own programs,
.MAKE to create a new text file with TECO,
.TECO to edit an old text file with TECO,
.SOS to create and edit a text file with SOS.

In this lesson you will learn a few more useful monitor commands.
%text
Which files have I got?
======================

The DIRECT command will list the names of all files,
which you have saved on disk. You just write DIRECT
to the monitor to get this listing. The listing
will give the name of the file, the size of it, and
the date and time when you last modified it.

if you write "DIRECT TOPS10.EXE" you get information about
only that single file.
%text
You can also indicate a simple pattern, so that all files whose
names match the pattern are listed.

In such a pattern you can use "*" to stand for any filename or
any filename extension, and you can use "?" to stand for any
character in a filename or extension.

EXAMPLES:

"DIRECT *.SIM" will list the names of all files with the
extension "SIM", that is, all SIMULA source program files.

"DIRECT MYPROG.*" will list the names of all files
with the name "MYPROG", regardless of the extension.

"DIRECT TOPS??.*" will list the names of all files
whose first four characters are "TOPS",
and with any extension.
%question comment DIRECT 1;
Write a command to list the names of all files with the
extension "EXE" (indicating executable core image),
on your own project-programmer number.
%order
%noextra
%right DIRECT *.EXE
%right direct .EXE
%right dir .EXE
%right DIR *.EXE
%right DIRECT ??????.EXE
That will work, but why not write "DIRECT *.EXE" instead?
%right DIR ??????.EXE
%same
%extra
%wrong DIRECT *.EXE
Your answer contained a part that should not be there,
otherwise it was right.
%algol extratest;
%wrong DIR *.EXE
%same
%wrong EXE .
The "." should be in front of the extension "EXE", not after it.
%wrong *.EXE
You forgot to write "DIRECT" which is the name of the
command you are using.
%lack dir
%same
%wrong ?
"?" is only necessary when you want to single out individual
characters. Use "*" instead, which represents the whole
filename.
%wrong .*
After the dot you put the extension, and that should not be 
any extension(".*") but the special extension ".EXE".
%wrong :
Maybe you mispunched ":" instead of "*".
%wrong *
After "*", you write ".EXE" to indicate that only the names
of files with that extension are to be listed.
%wrong [
No project-programmer number is necessary, when you omit the
project-programmer number the system automatically assumes
the number you are logged in under.
%wrong ]
%same
%lack *
A hint: Use an "*" in the command, since the asterisk matches
any file name.
%wrong
%same
%wrong
The correct answer is "DIRECT *.EXE".
%question comment DIRECT 2;
Write a command to list the names of all your files where the
first letter in the filename is "F".
%noextra
%order
%right DIRECT F?????.*
%right DIR F?????.*
%right dir f*.*
%right direct f*.*
%right dir f*
%right dir f?????
%right direct f*
%right direct f?????
%extra
%wrong dirf
You forgot a space after the command name.
%wrong directf
%same
%wrong F?????.
After "F?????." you write "*" to indicate any extension allowed.
%wrong F?????
After "F?????" you write ".*" to indicate any extension allowed.
%wrong F?
You must write five questionmarks after "F" to cover all file names
with up to six characters in them.
%wrong F
After "F" use the "?" convention to cover arbitrary characters.
%wrong
A hint: Write the filename as the letter "F" followed by
a number of questionmarks to indicate arbitrary characters.
%wrong
%same
%wrong
The correct answer is "DIRECT F?????.*".
%text
You can also list more than one filename pattern after the
word "DIRECT".

For example, "DIRECT PROG.FOR,PROG.REL,*.EXE"
will list the names of the two files PROG.FOR and PROG.REL
and will also list all files with the extension "EXE".
%text
Just because you are so good, you will get a real hard
question.
%question comment DIRECT 3;
Write a command to list the names of all files
where at least one of the letters in the extension is "A".
%noextra
%noorder
%right DIRECT *.A?? , *.?A? , *.??A
%right DIR *.A?? , *.?A? , *.??A
%right DIRECT *.A*,*.?A?,*.??A
%right DIR *.A*,*.?A?,*.??A
%extra
%right DIR .A?? , .?A? , .??A
%right dir .a* , .?A? , .??a
%wrong dir*
You forgot the space after the command name.
%wrong direct*
%same
%wrong ???
An extension can only contain three characters, and one of
them must be "A", so the text "???" in your answer cannot
be right, since that text spans three arbitrary characters.
%wrong * , * , *
The three extensions to find "A" in any of the three positions
should be "A??" and "?A?" and "??A".
%wrong * * *
You write "," between the three filename specifications.
%wrong *
You must use three filename specifications, one for the case
where the "A" is respectively the first, the second and the
third letter in the extension.
%wrong . ?
You must write "*" in front of the "." to indicate that
any filename with that extension is allowed.
%wrong ?
There is no "." in your answer. "." is used to delimit
the filename and the extension on it.
%wrong
A hint: "*.?A?" means any file with any extension where
the second letter in the extension is "A".
%wrong
%same
%wrong
The correct answer is "DIRECT *.A??,*.?A?,*.??A".
This was quite a difficult question.
%text if lastrights>0 then
Fantastic! You did it again!
%text
On many of the monitor commands you can add switches explaining
how the command is to be performed. A typical example is the
switch "SLOW" which you can add to the "DIRECT" command.
This switch causes "DIRECT" to give more information about
each file; You will be told not only the date when it was
last modified but also the date when it was last used.
%text
A switch must always be written with the character "/" in
front of it. That character indicates that a switch follows.

Example: DIRECT /SLOW *.*

Similarly the /FAST switch will cause filenames and
extensions only to be listed.
There are many other switches on the DIRECT command,
you can see a list of them in the DEC system 10 OPERATING
SYSTEMS COMMAND MANUAL.
%text
You can also indicate that you want to look at files
under another project-programmer-number than your own.
You just write the project-programmer-number inside square
brackets after the filename.

Example "DIRECT *.ALG[13,100]" will list the names of all
ALGOL source programs under the project-programmer-number 13,100.

Second example: "DIRECT *.ALG[13,*]" will list all ALGOL source
program names on all programmer numbers in project 13.
%question comment DIRECT 4;
Write a "DIRECT" command to list the names of all
files on any project where the first character in the
project number is "1". The project number has four digits.
%extra
%right DIRECT [1???,*]
%wrong t[
Did you forget a space?
%wrong r[
%same
%noextra
%order
%right DIR [1???,*]
%right DIRECT [1???,*] *.*
%right DIR [1???,*] *.*
%right DIRECT *.* [1???,*]
%right DIR *.* [1???,*]
%right DIRECT [1???,*] .*
%right DIR [1???,*] .*
%right DIRECT .* [1???,*]
%right DIR .* [1???,*]
%extra
%wrong [ / ]
Separate the project and the programmer number by a comma (",").
%wrong DIRECT [1???,*]
If you remove the redundant characters, then your answer will work.
%algol extratest;
%wrong DIR [1???,*]
%same
%wrong [1???,*]
You should begin with the command word "DIRECT".
%lack [
Write square brackets ("[", "]") round the project-programmer-number.
%if qz
On some terminals, use the dollar key for the left square
bracket ([) and the cross-hatch (number sign) for the right
square bracket (]).
%ifend qz
%lack ]
%same
%lack ,
There is no comma (",") between the project number and the
programmer number.
%wrong 1???
Since all different programmer numbers should be included, write
"*" in the position for the programmer number.
%wrong [ * ]
To match all project numbers beginning with "1" you use
the pattern "1???".
%wrong 1??? *
Write a "," comma between the pattern for the project
number and the pattern for the programmer number.
%wrong 1
After "1" write three question marks ("?") to match any four-digit
number beginning with "1".
%lack *
Since all project numbers were wanted, you can put an * in place
of the project number in your command.
%wrong
A hint: the project-programmer-number is represented in the form
[projectnummber,programmernumber]. Instead of numbers, you can
use * for any number, or ? for any digit in a certain position
%wrong
%same
%wrong
A hint: "DIRECT [*,*]" will list the names of all files for
all project-programmer-numbers. Instead of the first * you
must write something else to select only some projects.
%wrong
The correct answer is "DIRECT [1???,*]".
%text tma1:
A useful variation of the "DIRECT" command is to use the
"SINCE" switch to list only those files which have been
generated or modified after a certain time and date.

Example: "DIRECT *.*/SINCE:0" will list all files which
have been generated or modified this day.
%text
Printout of text files.
======================

If you want to get a full listing of a text file, you can use the
TYPE or PRINT commands. TYPE prints the file(s) on your terminal,
PRINT prints the file(s) on the line printer.

Example: "TYPE TREE.SIM" will type the SIMULA program TREE on
your conversational terminal.

Second example: "PRINT TOPS??.GNO,*.ALG" will print on the line
printer all GNOSIS lessons in which the first four letters of
the name of the lesson are "TOPS" and will also print all ALGOL
source program files.
%text
Changing the protection code.
============================

You can change the protection of a file by using the "PROTECT"
command. Suppose that you want to change the protection of
all files with the extension "EXE" to <555>. You then write
"PROTECT <555> *.EXE".

<555> means that everyone can read the file, but no one is
allowed to modify it. You can howewer yourself always change
the protection of the file with the "PROTECT" command e.g.
to <055> and then modify it.
%text
Deleting files.
==============

You can delete a file with the "DELETE" command.
Example: "DELETE *.REL" will delete all your files which
have the extension "REL". Think carefully before using
the DELETE command. If you are not sure, write first
a "DIRECT" command with the same file specification, to
see what will be deleted before it is too late.

Second example: "DELETE A.ALG,B.ALG,C.ALG" will delete
these three files.
%text
Renaming files.
==============

You can change the name of a file with the RENAME command.
Example "RENAME PROG.BAC=PROG.BAK" will change the name
of the file "PROG.BAK" to the new name "PROG.BAC". This is
a very useful command if you believe that you have destroyed
a file with TECO or SOS. The editors usually create backup copies
of your file  with the extension "BAK" for TECO, "Qxx" for SOS.
(Here xx are the same letters as in the original extension.)
But that backup copy will soon be dstroyed too if the
main file is destroyed, so by renaming it to the extension
"BAC" instead of "BAK" or "Qxx" you save it from being destroyed
by the editor.
%text
Copying files.
=============

The COPY command can be used to copy a file. Example:
"COPY X.A=Y.A" will create a new file "X.A" which will
be identical to your old file "Y.A".

You can also copy together several old files into one
large new file.

"COPY AB.ALG=A.ALG,B.ALG" will create a new file containing
first the contents of "A.ALG" and then the contents of
"B.ALG".

"COPY SUM.REL=F?????.REL" will copy together the "REL"
files of all programs whose first letter is "F".
%text morecopy:
To copy the file RESULT.DAT from DSKB to DSKA you write:
	COPY DSKA:=DSKB:RESULT.DAT
You need not specify the file name(s) on the left hand side
if they are to be the same as on the right hand side.
%text commandlist:
DIRECT will list the names of files.
TYPE will print the whole file on the conversational terminal.
PRINT will print the whole file on the line printer.
COPY will create a copy of a file with a new name
     or in a different place.
PROTECT will change the protection of a file.
RENAME will change the name of a file.
DELETE will delete a file.
%question comment COPY 1;
Write a command string to create a new file "SUM.SIM"
containing all files with the extension "SIM" concatenated
into one large file.
%order
%noextra
%right COPY SUM.SIM = *.SIM
%right COP SUM.SIM = *.SIM
%extra
%wrong copysum
There should be a space after the command name.
%wrong copsum
%same
%wrong COPY SUM.SIM = *.SIM
Your answer was right except for the redundant text.
%algol extratest;
%wrong SUM.SIM = *.SIM
You forgot the word "COPY" beginning your command string.
%wrong = *.SIM
To the left of the equal sign you write the name of the file
you are going to create, that is "SUM.SIM".
%wrong *.SIM
"*.SIM" should be written to the right of the "=" sign.
%wrong .SIM
Before ".SIM" you should write "*" to indicate any file
with that extension.
%wrong
A hint: "*.SIM" means all files with the extension "SIM".
%wrong
%same
%wrong
If you are not sure, you should try. That is the way you
learn more and more.

%same
%wrong
%same
%wrong
The correct answer is "COPY SUM.SIM=*.SIM".
A short list of the commands you just learnt:

%question comment TYPE;
Which command is used to print a file on your conversational
terminal;
%extra
%right type
%right ty
%wrong pri
The PRINT command will print the file on the line printer, not
on your conversational terminal.
%wrong
%wrong
The correct answer is "TYPE".
%goto commandlist
%question comment print;
Which command is used to print a file on the line printer?
%extra
%right PRINT
%right pri
%right list
LIST and PRINT can both be used. The difference is that LIST makes
a copy of your file immediately and then prints it. This means that
LIST is slower, but on the other hand you can immediately modify the
file and still get the version printed which was present when you made
your "LIST" command. With "PRINT", if you modify the file before the
line-printer gets to your request, the modified file will be printed.
%wrong TYPE
The TYPE command prints it on your conversational terminal,
not on the line printer.
%wrong cop
COPY LPT:=<filespecification>  could be used, but that is not
what I meant. The PRINT command is easier to use and has more options.
%wrong
%wrong
%wrong
The correct answer is the "PRINT" command.
%goto commandlist
%text filecommand:
The "FILE" command.
==================

A DEC-tape is a very small magnetic tape which is useful
to store small or medium-size files like source programs.
On a DEC-tape, you can remove and replace files irrespective
of order, just as on the disk.

The "FILE" monitor command is used to move files between your disk
area and a DEC-tape.

There are several variants of this:
.FILE Z to zero a whole DEC-tape(dangerous!!!!)
.FILE D to remove named files from a DEC-tape
.FILE F to copy named files from disk to a DEC-tape
.FILE R to copy named files from a DEC-tape to disk
.FILE W to wait until all previous FILE commands
from you have been executed, etc.
%text
Suppose that you want to move the two files 
"TOPS11.EXE" and "TOPS12.EXE" from the DEC-tape
"DEQZ23" to your disk area. Then you type
"FILE R,DEQZ23,TOPS11.EXE,TOPS12.EXE".
After that you push "RETURN" and then you
must wait until the files have been loaded.
You can know when this waiting ends by typing "FILE W"
and then wait until a monitor "." dot appears.
%question comment file f question;
What do you type to copy the file "MYPROG.ALG" from your disk area
to the DEC tape "PTAPE"?
%noextra
%order
%right file f,ptape,myprog.alg
%extra
%wrong filef
Did you forget a space after "FILE"?
%wrong file f,ptape,
After "PTAPE," you type the name of the file to be copied.
%wrong file f,ptape
After "ptape" type a ",".
%wrong file f,
After "FILE F," you type the name of the tape to which
you want to copy the file.
%wrong file f
After "FILE F" you type a ",".
%wrong file r
"FILE R" copies from tape to disk. To copy from disk to tape
you use the "FILE F" command.
%wrong file
After "FILE" you type a space and then "F" to indicate
that you want to copy a file from disk to a DEC-tape.
%wrong
Use the "file" command to move between disk and DEC-tape.
%wrong
%same
%text summary:
Summary
=======

Command		Effect
-------		------
DIRECT		will list the names of files.
TYPE		will print the whole file on the conversational terminal.
PRINT		will print the whole file on the line printer.
COPY		will create a copy of a file with a new name.
PROTECT		will change the protection of a file.
RENAME		will change the name of a file.
DELETE		will delete a file
FILE		handles reading and writing dectapes:

	FILE Z	to zero a whole DEC-tape(dangerous!!!!)
	FILE D	to remove named files from a DEC-tape
	FILE F	to copy named files from disk	to a DEC-tape
	FILE R	to copy named files from a DEC-tape	to disk
	FILE W	to wait until all previous FILE commands
		from you have been executed, etc.
%end