TOPS-10: Files and directories
In this post we'll look at how TOPS-10 handles files and directories, along with the commands to manipulate them.
Files
Files are named file.ext where file is 1-6 characters long and
ext 0-3. The extension is used to identify the type of file, eg
HELLO.FOR would be a Fortran source code file.
The * and ? wildcards operate like we are used to now, ?
matching one character and * matching any number of characters. An
example using the DIR command:
.dir hworld.* HWORLD FOR 1 <057> 12-Jan-79 DSKB: [100,100] HWORLD REL 1 <057> 12-Jan-79 Total of 2 blocks in 2 files on DSKB: [100,100]
Manipulating files
COPY, RENAME and DELETE do what you'd expect, but note that for
the first two you put the new name first followed by an =. For
example, to copy HWORLD.FOR to H2.FOR and then rename it to
H#.FOR you'd do:
.copy h2.for=hworld.for .rename h3.for=h2.for Files renamed: H2.FOR .dir h*.for HWORLD FOR 1 <057> 12-Jan-79 DSKB: [100,100] H3 FOR 1 <057> 15-Jan-79 Total of 2 blocks in 2 files on DSKB: [100,100]
Many of these commands are implemented using the PIP utility, which I'll look at in a later post.
Users and directories
Users are identified by a project number and a programmer number. These are both octal values (ie they consist of the digits 0-7), and values for both lower than 7 are reserved by the operating system. If you followed the quick start you logged in as project 100, programmer 100.
This is tied together with the concept of the directory. There is a Master File Directory and below that a User File Directory for each valid project/programmer pair. These are enclosed in square brackets when referencing files, for example:
.dir [100,100]hworld.for HWORLD FOR 1 <057> 12-Jan-79 DSKB: [100,100]
Project/programmer numbers can also be wirldcarded.
[1,1] is also the Master File Directory, so you can see a list of
all User File Directories by:
.dir [1,1]
1,1 1 <555> 21-Apr-78 DSKB: [1,1]
1,4 4 <775> 21-Apr-78
3,3 0 <777> 21-Apr-78
...
You can create sub-directories using the CREDIR command. For
example, to create a sub-directory test under my user directory I
would run CREDIR and at the prompt give the response [,,test]. I
could have typed [100,100,test] but as this is my current log on it
allows me to omit it. Running this looks like the below:
.r credir Create directory: [,,test] Created DSKB1:[100,100,TEST].SFD/PROTECTION:775 Create directory: ^C
I can then use this in commands.
.dir [,,test] %WLDDEM Directory DSK:[100,100,TEST] is empty
It is possible to change your current directory, but it is a little
more involved then typing cd on modern systems. Use the SETSRC
program and give it the CP command followed by the desired directory
at the * prompt. The TP command will list your current directory.
Type Control-C to exit.
.r setsrc *tp [100,100]/NOSCAN *cp [,,test] *tp [100,100,TEST]/NOSCAN *^C
To delete a sub-directory, ensure it is empty and then use DELETE on
the SFD file representing the directory. So for our example here,
test, you would do DELETE TEST.SFD.
Devices
Physical devices, such as tape drives, disks and the terminal, are referred to by device names which are 1-3 characters long, an optional digit followed by a colon. Some examples:
| Device | Meaning |
|---|---|
CDP: |
Card punch |
CDR: |
Card reader |
DTA000: |
DECTape unit #0 |
DTA001: |
DECTape unit #1 |
LPT: |
Line printer |
SYS: |
System library |
TTY: |
Your terminal |
You can see a list of physical devices on the system by typing
RESOURCES.
These can be referred to in commands. To type the contents of
HWORLD.FOR to your terminal you'd normally do TYPE HWORLD.FOR but
you could also do COPY TTY:=HWORLD.FOR.
There are also device names pointing to directories. An example is
SYS:, the location on disk where system executable files are stored.
We can see from the DIR command below that SYS~ points to user
[1,4].
.dir sys:pip.exe PIP EXE 44 <155> 8-Nov-76 33B(260) DSKB: [1,4]
You can create logical device names. Say your program was reading from
a DECTape where the unit may change depending on what is in use.
Rather than hard-coding the physical name, you can set up a logical
name with ASSIGN - for example ASSIGN DTA000: ABC: - and then use
ABC: to refer to the tape. DEASSIGN will remove the logical name.
Protection
A file has a protection code which is 3 octal digits enclosed in angle
brackets like <O57>. Each digit applies to a different class of user..
| Digit | Applies to |
|---|---|
| First | You |
| Second | Users with the same project number |
| Third | All users |
The values for each digit and their meaning:
| Digit | Meaning |
|---|---|
| 7 | No access |
| 6 | Execute |
| 5 | Read and execute |
| 4 | Append and everything in 5 |
| 3 | Update and everything in 4 |
| 2 | Write and everything in 3 |
| 1 | Rename and everything in 2 |
| 0 | Change protection and everything in 1 |
So a code of <057>, which is the default, means you can do anything, people in your project can read/execute, and all other users have no access.
Protection can be applied using the PROTECT command:
protect hworld.for<025>
Or directly at file creation time, eg via copy
copy world.for<000>=hworld.for
The default protection can be changed with SET DEFAULT PROTECTION.
Disk quota
Each regular user has an allowance of how much data they can store on
disk. A higher quota is given for when you are logged in compared to
logged out, to allow for creation of temporary files. The QUOLST
command allows you to see this: the units are 128-word blocks, so 576
bytes per block.
.r quolst User: 100,100 Str used left:(in) (out) (sys) DSKB: 135 99865 99865 132307
On an emulated system today this is not a concern. On a real system with small disks and many users, the quota could be set quite low (I read that some undergraduates were limited to 5 blocks).
An alternate way to log out of the system is KJOB. This will give
options for you to manage your files to get them under quota.
The quotas are set via the user administration utility REACT, which
we'll look at later.
Further information
See the Operating Systems Command Manual on Bitsavers for full documentation of TOPS-10 commands.
Questions, corrections, comments
I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.