TOPS-20 User's Guide

Chapter 6 Using disk files

This chapter describes:

  1. Using file structures
  2. Protecting directories and files
  3. Connecting to directories
  4. Accessing directories
  5. Copying files
  6. Renaming files
  7. Appending files
  8. Listing files
  9. Printing files
  10. Deleting and restoring files
  11. Creating temporary files
  12. Regulating disk file storage
  13. Long term off-line file storage
  14. Visible and invisible files

top

6.1 Using file structures

A file structure comprises one or more disk packs containing your files and other user files. A file structure name consists of alphanumeric characters followed by a colon. Even if a file structure is made up of several disk packs, it is referenced by one name. You create and reference files on a structure by specifying the structure name in the device field (dev:) of a file specification.

One file structure, the public structure (PS:), also known as the system structure, is the boot structure (BS:) by default and always remains on line during system operation. This public structure contains a directory for every user of the system, and the necessary accounting information to allow the users to log in. When you log in, you are connected to your directory on the public structure. This directory is referred to as your log-in directory and, in addition to the accounting information, contains some or all of your files.

Once you have entered your programs into the computer and executed them, you have several files in your directory. To obtain a listing of the filenames, type the DIRECTORY command, and press the return key.

        @DIRECTORY<RET>     Request a list of your filenames.
            PS:<SARTINI>    The structure on which your directory resides
                            and your directory name.
         ADDTWO.FOR.2       The edited version of your FORTRAN file.
           .QOR.1           An unedited backup file, for protection.
           .REL.2           Translation of your edited FORTRAN file.
         SQRT.ALG.1         Your original ALGOL program.
           .REL.1           Translation of your ALGOL file.

         TOTAL OF 5 FILES
        @

The files in your directory are listed in alphabetical order. When two or more files have the same name but different types, the name is listed only once, for the first file. Subsequent entries for the name are indented, and only the file types and generation numbers are listed.

If you use EDIT to edit an existing file for the first time, EDIT changes your original, unedited file into a backup file. In the process of making this backup file, EDIT changes the file type to Qxx, where xx are the last two letters of the original file type. EDIT creates this backup file so that you have an unaltered copy of your file. Every time you edit the file after the first time, the Qxx file is given a new generation number. In the example above, ADDTWO.QOR.1 is the backup file.

You can have and use files on structures other than the public structure. Like the public structure, these structures also contain directories and files. Unlike the public structure, you cannot log in to these structures. Although the public structure (PS:) and boot structure (BS:) remains on line during system operation, other structures may be mounted (put on line) and dismounted by the operator according to users' requests. To request the mounting and dismounting of structures, use the MOUNT STRUCTURE and DISMOUNT STRUCTURE commands.

The MOUNT STRUCTURE command informs the system that you require the use of a specific file structure (other than the public one). It causes the system to increment a count, called the mount count. The mount count for a structure is the number of users who have given the MOUNT command for that structure. This count assures you that a structure will remain mounted until you no longer need it. You usually have to give the MOUNT command before using files on any structure other than the public one. (Structures that require a MOUNT command are termed "regulated;" other structures are termed "unregulated.")

        @MOUNT STRUCTURE (NAME) MISC:
        Structure MISC: mounted

The DISMOUNT STRUCTURE command informs the system that you no longer require the use of a structure and decrements the mount count for that structure.

        @DISMOUNT STRUCTURE (NAME) MISC:
        Structure MISC: dismounted

After a structure is mounted, you can use the directories and files on that structure, depending on the protection codes set for those directories and files. (Refer to Section 6.2 for more information on directory and file protection codes and Section 6.3 and 6.4 for more information on connecting to directories and accessing files).

To find out which structures are presently mounted, give the INFORMATION STRUCTURE * command.

        @INFORMATION (ABOUT) STRUCTURE (NAME) *
        Status of structure BOSTON:
        Mount count: 4, open file count: 227, units in structure: 2
        Public Domestic
        Users who have MOUNTed BOSTON: SUSSMAN, TOMCZAK, LNEFF, DNEFF
        Users ACCESSing BOSTON: OPERATOR, R.ACE, SAMBERG, COMBS, SYLOR,
                KONEN, COHEN, ZIMA, JENNESS, BLOUNT, SUSSMAN, REILLY,
                CIRINO, 

                   .
                   .
                   .
        Status of structure PMH:
        Mount count: 1, open file count: 0, units in structure: 1
        Domestic
        Users who have MOUNTed PMH: HALL
        No users are ACCESSing PMH:
        Users CONNECTed to PMH: HALL

top

6.2 Protecting directories and files

The TOPS-20 file system allows flexibility in sharing some or all of your files with other users. Files and directories are protected at three levels: owner, group member, and all users. Usually files are protected to prevent access from non-owners who are not group members. When you want to share files among a known set of users, you can arrange to share files by asking your system manager to establish a group. Members of a group can access directories belonging to the group, and use files in those directories. (For a complete description of groups, refer to the TOPS-20 System Managers Guide.)

The access to each directory and file is determined by a protection number. You may have some files in your directory that you do not want to share. By setting the proper file protection you can prevent users from accessing these files, while allowing them to use other files in your directory.

Each directory protection number and file protection number comprises six digits, divided into three distinct sections that contain two digits each. The first two digits specify the owner's access; the second two digits specify the group members' access; and the third two digits specify all other users' (also called world) access.

                              PROTECTION CODE      

                          dd        dd        dd    

                         Owner    Group    All Users

top

6.2.1 Directory Protection Numbers

The digits in a protection number have different meanings, depending on whether they are in a directory protection number or in a file protection number. Table 6-1 lists the directory protection digits.

   Table 6-1:  Directory Protection Digits

   ___________________________________________________________________

     Digits                      Permit
   ___________________________________________________________________

       77         Full access to the directory is permitted.

       40         Access to files in the  directory  according  to  the
                  protection   number   on   the  individual  files  is
                  permitted.   To  delete  and   expunge   the   entire
                  directory (though these digits permit expunging files
                  on an individual basis), you  must  also  assign  the
                  digit  10.  To create files, you must also assign the
                  digit 04.

       10         Connecting  to  the  directory   without   giving   a
                  password,  undeleting  files,  expunging  the  entire
                  directory,  changing  times,  dates  and   accounting
                  information for files is permitted.  All other access
                  is governed by the protection on the individual file.

       04         Create files in the directory.

       00         Access to the directory is not permitted.
   ___________________________________________________________________

You can add directory protection digits together. For example, if your directory protection number is 774000, you have full access as the owner of the directory, you allow members of the group to access the directory according to the protection on individual files, and you prohibit all other users from accessing the directory. If you want to allow members of the group not only to access the directory, but also to create files in your directory, you can add the directory protection code 04 to the 40 to get 44. Your entire directory protection code then becomes 774400.

top

6.2.2 File Protection Numbers

Table 6-2 lists the file protection digits.

   Table 6-2:  File Protection Digits

   ____________________________________________________________________

     Digits                      Permit
   ____________________________________________________________________

       77         Full access to the file.

       40         Read the file.

       20         Write or delete the file.

       10         Execute the file.

       04         Append to the file.

       02         Find the file specification using wildcarding.

       00         Find the file  specification  only  if  the  file  is
                  specified explicitly and completely.  No other access
                  is allowed.
   ____________________________________________________________________

The system default protection number for files is generally 777700. This means that the owner of a file and members of the owner's group have full access, and all other users have no access to the file.

As with directory protection codes, you can construct file protection codes by adding the protection digits together. For example, a code of 44 allows reading and appending, but prohibits modifying or deleting the file, or listing the file in a DIRECTORY command.

top

6.2.3 Checking Protection Numbers

To validate access to directories and files, the system scans the protection code beginning with the two digits to the right, and moves to the left until it has reached the highest level of access.

The system scans a file or directory protection number in the following way:

  1. It scans the two digits to the far right in the protection code to see if all users have access.
  2. If all users have access, you can access the file or directory.
  3. If all users do not have access, the system moves to the two digits in the center of the protection number to see if members of the group have access.
  4. If members of a group have access, you can access the file or directory if you are in the group.
  5. If members of a group do not have access, the system moves to the two digits to the far left of the protection code to see if the owner has access.
  6. If the owner has access, you can access the file or directory if you are the owner.
  7. If the owner does not have access, the system prints an error message.

The protection system works in the following way. For example, you want to type the file TEST.TXT in user HOLLAND'S directory on your terminal. Before printing the file you requested, the system scans the protection code on the directory <HOLLAND> to validate that you have access. If you are not allowed to access the directory, the system prints an error message and cancels the command.

        @TYPE (FILE) <HOLLAND>TEST.TXT
        ?Directory access privileges required - "<HOLLAND>TEST.TXT"

If the directory protection allows you the access, the system scans the protection on the individual file TEST.TXT. If you are not allowed to access the file, the system prints an error message and cancels the command.

        @TYPE (FILE) <HOLLAND>TEST.TXT
        ?READ protection violation for:  "<HOLLAND>TEST.TXT.2"

If the file protection allows you to access the file, the system prints the file on your terminal.

To print a directory protection number, use the INFORMATION DIRECTORY command with the VERBOSE subcommand. The directory protection number is in the field "Protection of directory". To print the file protection number, use the VDIRECTORY command (or the DIRECTORY command with the PROTECTION subcommand).

        @VDIRECTORY (OF FILES) TEST.FIL
           PS:<PORADA>
         TEST.FIL.1; P777700   1 110(7)   21-Mar-88 11:44:25 PORADA

top

6.2.4 Changing a Directory Protection Number

To change a directory protection number, use the SET DIRECTORY PROTECTION command.

        @SET DIRECTORY PROTECTION (OF DIRECTORY) <EMORRILL> (TO) 770000

top

6.2.5 Changing a File Protection Number

The system assigns a default file protection number to all files created in a directory. This default is usually 777700. To change the default file protection number for a directory, use the SET DIRECTORY FILE-PROTECTION-DEFAULT command.

        @SET DIRECTORY FILE-PROTECTION-DEFAULT <BLACK> 770000

To change a file protection number, use the SET FILE PROTECTION command.

        @SET FILE PROTECTION (OF FILES) TEST.FIL (TO) 774400
         TEST.FIL.1 [OK]

To print a directory's default file protection number use the INFORMATION DIRECTORY command, with the VERBOSE subcommand.

top

6.3 Connecting to directories

When you log in, you are automatically connected to the directory on the public structure that has the same name as your user name. For example, user McElmoyle is connected to <MCELMOYLE> on the public structure:

        @LOGIN (USER) MCELMOYLE (PASSWORD)___(ACCOUNT) 341

If you need to work in another directory, you can connect to that directory. When you connect to a directory, the system automatically disconnects you from the directory you are presently in and uses the new directory as your default directory. Your default directory is the one the system assumes when you omit a directory name in a file specification.

In addition, you have owner rights for that directory, just as if you logged in to it. The owner rights for a directory are valid as long as you are connected to that directory; the rights terminate when you connect to another directory. You always retain the owner rights to the files in your log-in directory.

You can connect to a directory on the public structure or on another on-line structure. To connect to another directory, give the CONNECT command and the name of the directory you want to use. You are prompted for a password for the directory depending on your ownership and group rights for the directory.

The example below illustrates the effects of logging in, then connecting to another directory on the public structure. When you (user MCELMOYLE) log in to the system, you are connected to your own directory on the public structure. When you omit a directory name and/or structure name in a file specification, the system assumes your logged-in directory <MCELMOYLE> on the public structure. After you log in, connect to the directory <BROWN> on the public structure. Now, if you omit the directory name and/or structure name in a file specification, the system assumes your connected directory <BROWN> on the public structure.

        @LOGIN (USER) MCELMOYLE (PASSWORD)___(ACCOUNT) 341
         Job 5 on TTY26 31-Mar-88 14:56:24, Last Login 30-Mar-88 08:24:13
        @CONNECT (TO DIRECTORY) <BROWN>
        Password:___
                         _____PS:_____
                         |           |
                         |           |
                         |-----------|
   User MCELMOYLE------->| MCELMOYLE |
               C  -------|           |
               O  |      |-----------|
               N  |      |-----------| \           
               N  ------>|   BROWN   | | Connected 
               E         |           | | Directory
               C         |-----------| /
               T         |           |
                         -------------
                         \___________/
                           Connected 
                           Structure

When you give the CONNECT command for a directory that is located on a different structure, your default structure also changes. The system assumes both the connected structure and the connected directory when you omit them in a file specification.

The example below illustrates the effects of logging in on the public structure and then connecting to a directory on another structure named MISC:. When you (user MCELMOYLE) log in, you are connected to your directory on the public structure. After you log in, connect to the directory <BROPHY> on the structure MISC:.

        @LOGIN (USER) MCELMOYLE (PASSWORD)___(ACCOUNT) 341
         Job 28 on TTY26 31-Mar-88 12:02:46, Last Login 30-Mar-88 08:32:26
        @CONNECT (TO DIRECTORY) MISC:<BROPHY>
        Password:___


                         _____PS:_____              ____MISC:_____
                         |           |              |            |
                         |           |              |            |
                  LOGIN  |-----------|   CONNECT    |------------|
   User MCELMOYLE------->|<MCELMOYLE>|------------->|  <BROPHY>  |
                         |-----------|              |------------|  
                         |           |              |            |
                         |           |              |            |
                         -------------              --------------  
                                                   \______________/
                                                       Connected 
                                                       Structure

If you later omit a structure name or a directory name from a file specification, the system assumes the structure MISC: and the directory <BROPHY>.

If you forget which directory or structure you are connected to, give the INFORMATION JOB-STATUS command. If no directory name is printed, then you are connected to your logged in directory.

        @INFORMATION (ABOUT) JOB-STATUS
         Host AURORA
         Job 105, TTY46, User HIGGINS, SUMMIT:<HIGGINS>
         Account 341

top

6.4 Accessing directories

To access another directory and remain connected to your present directory, give the ACCESS command.

When you access a directory, you are actually working in your connected directory but you also have owner and group rights to the other directory. This means that you can use the files in the directory you have accessed by specifying that directory in the file specification. Unless you specify otherwise, any file you create appears in your connected directory. If you want the file to be written into the directory you have accessed, you must specify the directory name in the file specification. If the directory you access is located on a different structure than your connected directory, you must specify the structure and directory names in any file specification.

The example below illustrates the effects of logging in, then accessing another directory on the public structure. When you (user MCELMOYLE) log in to the system, you are connected to your login directory. After you log in, access the directory <BROWN> on the public structure. You now have owner and group rights for directory <BROWN>.

        @LOGIN (USER) MCELMOYLE (PASSWORD)___(ACCOUNT) 341
         Job 32 on TTY26 31-Mar-88 10:08:16, Last Login 30-Mar-88 11:36:44
        @ACCESS (TO DIRECTORY) <BROWN>
        Password:___


                         _____PS:_____
                         |           |                        
                         |           |
                         |-----------|\          \
   User MCELMOYLE------->| MCELMOYLE || Connected | Has "owner"
                A -------|           || Directory | rights only
                C |      |-----------|/          /
                C |      |-----------| \           
                E ------>|   BROWN   | | MCELMOYLE has 
                S        |           | | "owner" and
                S        |-----------| / "group" rights
                         |           |
                         -------------
                         \___________/
                           Connected 
                           Structure

You can access more than one directory during a job session. You can access a directory on one structure and also access a directory on a different structure. If each directory you access is located on a different structure, the owner and group rights for these directories remain in effect throughout your entire job session (from LOGIN to LOGOUT) or until a structure is dismounted. You can access only one directory per structure, however. If you access a second directory on the same structure, your access to the first directory is cancelled. You always retain your owner rights to your log-in directory on the public structure. However, when you give the ACCESS command to a different directory on the public structure, you lose the group privileges of your log-in directory.

You can log in, access another directory on the public structure, then access a directory on another structure, MISC:, as in the following example:

        @LOGIN (USER) MCELMOYLE (PASSWORD)___(ACCOUNT) 341
         Job 32 TTY26 31-Mar-88 10:08:14, Last Login 30-Mar-88 11:16:02
        @ACCESS (TO DIRECTORY) <BROWN>
        Password:___
        @ACCESS (TO DIRECTORY) MISC:<BROPHY>
        Password:___


               ____PS:____                          ___MISC:___
               |         |                          |         |
               |         |                          |         |
     User      |---------|\           \             |         |
   MCELMOYLE-->|         ||           | Has "owner" |         |
             --|         || Connected | rights only |---------|\ 
            A| |MCELMOYLE|| Directory /             |         || MCELMOYLE
            C| |         ||                 ACCESS  | BROPHY  || has "owner
            C| |    - - -|| - - - - - - - - - - - ->|         || and "group"
            E| |---------|/                         |         || rights
            S| |---------|\                         |---------|/
            S| |         || MCELMOYLE has           |         |
             ->| BROWN   || "owner and              |         |
               |         || "group" rights          |         |
               |---------|/                         |         |
               -----------                          -----------
               \_________/
                Connected 
                Structure

top

6.5 Copying files

You can use the COPY command to reproduce one of your files. This procedure is useful if you want to change a file without altering the original file.

To copy a file to another file, give the COPY command. The COPY command copies the contents of an existing file (called a source file) to a destination file, and keeps the original file. The following example shows how to copy the existing file TEST1.DAT to the destination file 2TEST.DAT.

        @COPY (FROM) TEST1.DAT.1 (TO) 2TEST.DAT.2 !New generation!
         TEST1.DAT.1 => 2TEST.DAT.2 [OK]

You can also use the COPY command to copy a file from another user's directory. First give the ACCESS command with the other user's directory name and password. (The password does not print on the terminal.) Then type COPY, and press the ESC key. The system prints (FROM). Type the other user's directory name (enclosed in angle brackets), the name of the file you want to copy and the ESC key. The system prints the generation number and the guideword (TO). Press the RETURN key. The other user's file is copied to your disk area. The file keeps the same name.

        @ACCESS<ESC>(TO DIRECTORY) <PORADA><RET>
        Password: <RET>

        @COPY<ESC>(FROM) <PORADA>TODAY.EXE<ESC>.3 (TO)<RET>
         <PORADA>TODAY.EXE.3  => TODAY.EXE.1 [OK]

You can also copy a file from another user's directory and give the file a different filename. To do this, use the procedure described above. The system prints the generation number and guideword (TO):

        @COPY<ESC>(FROM) <PORADA>TODAY.EXE<ESC>.3 (TO)

Instead of pressing the RETURN key, as in the previous example, type the name that you want to give the new file. When you have typed the new name, press the RETURN key. The system prints a message telling you that it has copied the file.

        @COPY<ESC>(FROM) <PORADA>TODAY.EXE<ESC>.3 (TO) TEST.EXE<RET>
         <PORADA>TODAY.EXE.3  => TODAY.EXE.1 [OK]
        @

You can copy multiple files by using a wildcard. For example, if you type COPY (FROM) *.FOR, the system places each file with the file type .FOR into a destination file. If you type COPY (FROM) TEST.*, the system places each file with the filename TEST into a destination file.

        @COPY (FROM) TEST.* (TO) NEWTST.*.-1
         TEST.FOR.1 => NEWTST.FOR.1 [OK]
         TEST.TXT.2 => NEWTST.TXT.1 [OK]

If you use recognition input in the above example, when you press ESC after the filename NEWTST, the system rings the terminal bell, asking you to type more information. In this example, type a period after the filename, indicating to the system the end of the filename; and press ESC. The system prints the wildcard character, *, and a .-1 generation number. The -1 generation number is a symbolic generation number and indicates to you that when the system processes the command line, it will use one greater than the highest number of each file. (Refer to Section 4.2.6, Generation Numbers - .gen, for more information on symbolic generation numbers.)

top

6.6 Renaming files

You can use the RENAME command to change the name of a file or to put a file into another directory on the same structure. When you use RENAME, the system simply changes the file specification instead of actually duplicating the file.

        @RENAME (EXISTING FILE) TEST1.DAT.* (TO BE) TESTAL.DAT.-1
         TEST1.DAT.1 => TESTAL.DAT.2 [OK]

To move files from one structure to another, use the COPY command. RENAME will not work across structures. After copying the file, you can delete the original.

        @COPY (FROM) MISC:TEST.FIL.5 (TO) TEST.FIL.1 !New file!
         MISC:TEST.FIL.5 => TEST.FIL.1 [OK]
        @DELETE MISC:TEST.FIL.5

top

6.7 Appending files

To add the contents of one or more source files to the end of a destination file, give the APPEND command. The destination file can be an existing file or a new file. The following example shows how to add the contents of the source file STAT.TXT.5 to the end of the file CHECK.TXT:

        @APPEND (SOURCE FILE) STAT.TXT.5 (TO) CHECK.TXT
         STAT.TXT.5 [OK]

You can append a series of files with the same filename or file type using a wildcard. The following example shows how to append all files with the file type .FOR. Notice that these files are appended in alphabetical order when using a wildcard for the filename.

        @APPEND (SOURCE FILE) *.FOR (TO) ATEST.FOR.1 !New file!
         ACCOUN.FOR.2 [OK]
         ACCTST.FOR.1 [OK]
         NEWTST.FOR.1 [OK]
         TEST.FOR.1 [OK]

You can append files from a directory on one structure to a directory on another structure. The system prints the structure name, the directory name and the filename of the source file, followed by the message [OK] when the file has been appended.

        @APPEND (SOURCE FILE) PS:<DOE>SMALL.FOR (TO) MISC:<DOE>LARGE.FOR
           PS:<LATTA>SMALL.FOR.2 [OK]
NOTE

Some programs, such as COBOL and SORT, cannot use appended files.

top

6.8 Listing files

To display a copy of your file on your terminal, type the TYPE command, and press the ESC key. After (FILE), type the filename and file type of your file. Press the RETURN key.

To see a copy of ADDTWO.FOR type the following command:

        @TYPE (FILE) ADDTWO.FOR

If you want TOPS-20 to stop printing a file after it begins, type a CTRL/O. CTRL/O stops the printout. You can resume the printing by typing a second CTRL/O.

top

6.9 Printing files

To print a file or files, give the PRINT command. The PRINT command places entries into the line printer output queue.

        @PRINT (FILES) UPDATE.CBL
        [Printer job UPDATE queued, request  57, limit 27]

To see that your job is in the line printer output queue, give the INFORMATION OUTPUT-REQUESTS command. The system lists all the jobs in the queue. If you want only the entries of your job(s), include the /USER switch.

        @INFORMATION (ABOUT) OUTPUT-REQUESTS

        Printer Queue:
        Job Name  Req#  Limit            User
        --------  ----  -----  ------------------------
        * BOX       53    270  LYONS                      On Unit:0
           Started at 14:29:29, printed 122 of 270 pages
        * UPDATE    57     27  SARTINI                    On Unit:1
           Started at 14:38:18, printed 0 of 27 pages
          MIDAS     34     27  REILLY                     /Forms:NARROW
        There are 3 Jobs in the Queue (2 in Progress)

You can control several conditions of your print request by using switches with the PRINT command.

To simply print a file, it is not necessary to include switches. However, you can include switches with the PRINT command. To obtain a list of valid switches, type PRINT, followed by a ?. The list of switches the system prints contains both job switches and file switches.

        @PRINT ?  /SPOOLED-OUTPUT
          or Job switch, one of the following:
         /ACCOUNT:            /AFTER:               /CHARACTERISTIC:
         /DESTINATION-NODE:   /FORMS:               /GENERIC
         /JOBNAME:            /LIMIT:               /LOWERCASE
         /NOTE:               /NOTIFY:              /PRIORITY:
         /REMOTE-PRINTER:     /SEQUENCE:            /UNIT:
         /UPPERCASE           /USER:
          or File switch, one of the following:
         /BEGIN:         /COPIES:        /DELETE           /FILE:
         /HEADER         /MODE:          /NOHEADER         /PRESERVE
         /REPORT:        /SPACING:
         or ","
         or File specification
        @PRINT

If you include a job switch with the PRINT command, the entire job is affected by the switch. For example, if you print three files and you add the /AFTER: switch, all three files will be printed after the time you specify.

        @PRINT (FILES) LARGE.DAT, MYTEST.DAT, TEST1.DAT /AFTER:15-MAR-88
        [Printer job LARGE queued, request #58, limit 27]

If you include a file switch with the PRINT command, only the file directly before the switch is affected. For example, if you print three files and you add the /COPIES:6 switch after the first filename, the system prints six copies of the first file only.

        @PRINT (FILES) LARGE.DAT/COPIES:6, MYTEST.DAT, TEST1.DAT

A file switch can act as a job switch when placed before all files in a command. For example, if you print three files and you add the /COPIES:6 switch before the first filename, the system prints six copies of each of the three files.

        @PRINT (FILES)/COPIES:6,LARGE.DAT,MYTEST.DAT,TEST1.DAT

You can direct a PRINT request to a remote destination by including the /REMOTE-PRINTER switch. The destination is either a VMS printer queue for DQS printers or a LATserver PORT or SERVICE for LAT printers. To specify a string that communicates file features such as layout or lettering type, include the /CHARACTERISTIC switch.

The following example shows how to print a job with a PORTRAIT 90 characteristic on a XEROX 8700 printer on a VMS system.

        @PRINT FILE4.MEM/REMOTE-PRINTER:XEROX/CHARACTERISTIC:P90
        [Printer job FILE4 queued, request #33, limit 1
        files]

You can direct a PRINT request to a remote node by specifying the /DESTINATION-NODE switch. The remote node can be either an IBM remote station, a node in a TOPS-20 cluster, a VMS remote node or a LATserver.

The following example shows how to PRINT a job on a printer service named XEROX on a LATserver named LAT97.

        @PRINT FILE.DAT/REMOTE-PRINTER:XEROX/DESTINATION-NODE:LAT97
        [Printer job FILE queued, request #45, limit 1 files]

You can specify the SET REMOTE-PRINTING PRINTER command to establish the /REMOTE-PRINTER queue and characteristic parameters. The SET REMOTE-PRINTING command can be invoked at command level or within a command file.

The following example shows how to define the name of a remote printer queue on node OURVAX.

        @SET REMOTE-PRINTING PRINTER XEROX SI$8700 OURVAX
        @

Now, to direct a print request to the remote printer queue:

  
       @PRINT MYFILE.MEM/REMOTE-PRINTER:XEROX
       @

For more information about directing print requests to remote destinations, refer to the TOPS-20 Commands Reference Manual.

top

6.9.1 Modifying a PRINT Request

To change and/or add one or more switches to a previously issued PRINT command, give the MODIFY command. After you give the MODIFY command, type PRINT, followed by the first six letters of the jobname, or the request ID, then type the switch you want to change or add.

You can modify almost all PRINT command switches. To obtain a list of switches you can modify, give the MODIFY PRINT/ command, followed by a question mark (?).

The following example shows how to modify the PRINT request for LARGE.DAT by including the /AFTER: switch:

        @MODIFY (REQUEST TYPE) PRINT (ID) LARGE /AFTER:25-MAR-88
        [1 Job modified]

After you give the command, the system prints a message informing you that the job was modified. If the system is processing the entry when you give the MODIFY command, it does not modify the job and prints the message [No Jobs modified].

top

6.9.2 Canceling a PRINT Request

To cancel or remove entries you have previously placed in the line printer output queue, give the CANCEL command. After you give the CANCEL command, type PRINT, followed by the first six letters of the jobname or the request ID of the job you want to remove.

Once the CANCEL command removes the entry from the line printer output queue, the system prints the message [1 Job Canceled]. If the system is processing the entry when you give the CANCEL command, it stops the job and prints the message, [1 Job Canceled (1 was in progress)].

The following example shows how to cancel the PRINT request for TEST.FOR.

        @CANCEL (REQUEST TYPE) PRINT (ID) TEST
        [1 Job canceled]

If you have several PRINT jobs in the lineprinter output queue, you can cancel them all by using an asterisk.

        @CANCEL (REQUEST TYPE) PRINT (ID) *
        [3 Jobs canceled]

You can cancel a PRINT request to a remote printer in the same TOPS-20 cluster as the requesting node by including the /DESTINATION-NODE: switch in the command. This switch cancels only the print requests that were made from the local node. Other print requests made on the remote node are not affected.

The following example shows how to cancel a remote print request.

        @CANCEL PRINT SUM7/DESTINATION-NODE:KL2102
        [1 print request cancelled]

Note that PRINT requests directed to a remote node not in the same cluster as the requesting node cannot be cancelled from the requesting node.

top

6.9.3 Setting Defaults for the PRINT Command

If you want the PRINT command to always contain certain switches, give the SET DEFAULT PRINT command, followed by the switch or switches. Whenever you give a PRINT command, the switches you specified in the SET DEFAULT command are automatically included in the PRINT command.

To give the /NOTE switch with PRINT commands, place the following command in COMAND.CMD.

        @SET DEFAULT (FOR) PRINT /NOTE:FLOOR4

Every time you give the PRINT command, the system includes the switch /NOTE:FLOOR4 in the command.

To avoid having to type the SET DEFAULT PRINT command every time you log in to the system, put this command in a COMAND.CMD file. (Refer to Section 1.7 for information about a COMAND.CMD file.)

To see which defaults you set for the PRINT command, give the INFORMATION DEFAULTS PRINT command.

        @INFORMATION (ABOUT) DEFAULTS (FOR) PRINT
         SET DEFAULT PRINT /NOTE:FLOOR4

top

6.10 Deleting and restoring files

When you no longer need to keep a file, you can delete it by giving the DELETE command. The DELETE command marks the file for automatic deletion; it does not actually erase the file.

The deleted files in your logged-in or connected directory are erased (expunged) when one of the following occurs:

The EXPUNGE command erases all files marked for deletion since the last time the directory was expunged. Deleting and erasing files are separate operations. Therefore, once you delete a file, it does not immediately disappear. If you delete a file by mistake, you can type the UNDELETE command to restore the file to your directory. Type this command as soon as you detect your mistake; otherwise, you may not be able to restore the file. You cannot restore a file once you log off the system.

To delete the file TEST.FIL from your directory, give the following command:

        @DELETE (FILES) TEST.FIL
         TEST.FIL.5 [OK]

You can give the DIRECTORY command with the deleted subcommand to list all the files that have been deleted but not yet expunged.

        @DIRECTORY (OF FILES) TEST.FIL.5,
        @@DELETED
        @@

           PS:<PORADA>
         TEST.FIL.5

To restore TEST.FIL, give the UNDELETE command.

        @UNDELETE (FILES) TEST.FIL.5
         TEST.FIL.5 [OK]

If you give the DIRECTORY command again, you will see that the file has been restored in your directory.

If you delete a file and give the EXPUNGE command, the file is erased immediately.

        @DELETE (FILES) TEST.FIL
         TEST.FIL.5 [OK]
        @EXPUNGE (DELETED FILES)
           PS:<PORADA> [3 pages freed]

If you expunge a file by mistake, contact the operator. Most systems keep backup tapes from which you can obtain an older version of the file. If you expunge a newly-created file, one that has not been backed-up on tape, you cannot recover it.

CAUTION

Do not delete files and plan to undelete them at a later time, because deleted files may be expunged by the system at any time.

top

6.11 Creating temporary files

When you have a file that you need only for the current terminal session, such as a scratch file, give the file the ;T attribute. The ;T attribute indicates that the file is temporary. When you log off the system, the system deletes and expunges any temporary files in your logged-in and/or connected directories.

One way to create a temporary file is to use the COPY TTY: command. This command simulates the action of the CREATE command by copying the text you type on your terminal (device TTY:) to a file.

Give the COPY TTY: command, type the contents of the file and end your input with a CTRL/Z:

        @COPY (FROM) TTY:  (TO) TEMP.FIL;T
         TTY:  => TEMP.FIL.100160;T

        ESCAPE 031
        EXTENDED
        OPAQUE
        PAGE
        ^Z

To give an existing file the ;T attribute, use the RENAME command.

        @RENAME (EXISTING FILE) SCRATCH.FIL (TO BE) SCRATCH.FIL;T
         SCRATCH.FIL.1 => SCRATCH.FIL.100014;T [OK]

Do not use recognition input to print the second file name in the RENAME command. Recognition prints the comment !New generation! after the file specification and causes the ;T attribute to be ignored.

You can assign any generation number to a temporary file. If you do not specify a generation number, the system assigns the file a generation number of 100000 plus your job number. In the above example, the user's job number is 14; the system added 100000 for a generation number of 100014. Two users connected to the same directory can both create temporary files; however, if one user logs off, the other user's temporary files are not deleted, because the files are identified by different job numbers.

Refer to Appendix C of the TOPS-20 Commands Reference Manual for a complete list of file attributes.

top

6.12 Regulating disk file storage

The system manager sets an upper limit on the amount of disk space for each directory on the system. This disk space, referred to as directory storage allocation, is allotted as a number of pages.

Each directory receives a specific number of pages. To see the number of pages allocated to your directory, and the number of pages you are using, give the INFORMATION DISK-USAGE command.

        @INFORMATION (ABOUT) DISK-USAGE (OF DIRECTORY) <SARTINI>
         PS:<SARTINI>
         37 Pages assigned
         50 Working pages, 50 Permanent pages allowed
         34142 Pages free on PS:

In the example above, user SARTINI has 37 pages assigned to his directory, and a working storage allocation and permanent storage allocation of 50 pages. There are 34142 free pages remaining on this file structure.

The system automatically checks your working storage allocation whenever you create a new file page. If you are over that allocation, it prints the message "?Disk or directory full, or quota exceeded" and does not let you continue writing to your file. You can delete any unimportant or temporary files and expunge the directory to get under your working allocation.

Whenever you give a LOGIN or LOGOUT command or connect to another directory, the system checks the permanent disk storage allocation of your connected directory. If it is exceeded, the system prints a message in the form:

        <directory> Over permanent storage allocation by n page(s)
CAUTION

If you exceed your working storage allocation, the system programs listed in Table 4-2 expunge any deleted files. When a system program expunges deleted files, it prints a message; however, once you see the message, you cannot halt the expunging process.

Depending upon the policy at your installation, if you do not regulate your own disk storage allocation, the operator may regulate it for you by running a system program to move some of your disk files to magnetic tape for short-term off-line storage. This program looks for directories that are over quota and moves files from the directories until they are under quota. The operator runs this program as often as required to bring directories under quota. This forced migration of files from disk to tape is used to keep the system disk space free.

The system manager determines which type of files the program moves to tape storage. However, if you want to specify a particular order in which you want the files moved when the operator runs the program, you can include a MIGRATION.ORDER file in your log-in directory. In the MIGRATION.ORDER file, you can list the files you want moved first. For example, to request that temporary files and files with the .LST file type be migrated before your other files, place this line in the MIGRATION.ORDER file: *.TMP, *.LST

The SET FILE RESIST command also gives you some control over involuntary file removal. It delays migration of the specified files for as long as possible.

        @SET FILE RESIST (MIGRATION OF FILES) MEMO.INI
         MEMO.INI.1 [OK]

The file MEMO.INI will be among the last files to be removed from the disk.

To see the files that will "resist" migration, give the DIRECTORY command with the RESIST-MIGRATION subcommand:

        @DIRECTORY (OF FILES) ,
        @@RESIST-MIGRATION (FILES ONLY) 
        @@

           PS:<TUCKER.USER>
         MEMO.INI.1
         USEDOC.DST.3
         USEPLN.DST.2

         Total of 3 files

To see the files that were moved to off-line storage by the system program, give the DIRECTORY command. Next to the names of the files that were moved, the system prints ;OFFLINE.

        @DIRECTORY (OF FILES)

           PS:<SARTINI>
         2TEST.DAT.3
         NEWACCT.LST.1;OFFLINE
         OVERVIEW.LST.10;OFFLINE
         SQUARE.B20.1

         Total of 4 files

If you need to use the file, give the RETRIEVE command followed by the name of the file. The RETRIEVE command notifies the system that you are requesting the restoration of the file from off-line storage.

        @RETRIEVE (FILES) MYTEST.DAT.1

         MYTEST.DAT.1 [OK]

To see your retrieval request, give the INFORMATION RETRIEVAL-REQUESTS command. The system prints a list of requests in the retrieval queue.

        @INFORMATION (ABOUT) RETRIEVAL-REQUESTS

        Retrieval Queue:
         Name     Req#    Tape 1   Tape 2   User
         ------   ----    ------   ------   ---------------------
         ADVENT      6      5845     5641   ENGEL
         CHESS       7      5845     5641   ENGEL
         MYTEST     68      5854     5852   SARTINI
         OTHELL      9      5641     8459   ENGEL
         There are 4 jobs in the Queue (None in Progress)

You can remove any retrieval requests before the contents of the off-line file are restored to disk by using the CANCEL command.

        @CANCEL (REQUEST TYPE) RETRIEVE (ID) MYTEST
        [1 Job canceled]

top

6.13 Long term off-line file storage

If you have disk files that you do not use, but want to keep, you can mark these files for extended off-line storage by using the ARCHIVE command. The operator periodically runs a program that moves the files marked for archiving from disk to magnetic tape for off-line storage. After the program moves the files to tape, it sends a message through the MAIL program telling you the file has been archived and its contents deleted from the disk. Your system manager can tell you which files you should archive, and how long they will be stored. The system manager can also tell you how often the operator runs the program to move the files marked for archiving.

You can also use DUMPER for off-line storage. Refer to the DUMPER description in the TOPS-20 User Utilities Guide for more information.

top

6.13.1 Archiving Files

To mark a file for archiving, give the ARCHIVE command, followed by the name of the file you want archived.

        @ARCHIVE (FILES) CHECK.TXT
         CHECK.TXT.1 [Requested]

top

6.13.2 Getting Information about Archive Status of Files

To see that the file is marked for archiving, give the INFORMATION ARCHIVE-STATUS command, followed by the name of the file.

        @INFORMATION (ABOUT) ARCHIVE-STATUS (OF FILES) CHECK.TXT
         CHECK.TXT.1 Archive requested

You can also give the INFORMATION ARCHIVE-STATUS command without any argument. The system prints a list of your files that are archived, and files for which archiving has been requested.

Once you mark a file for archiving, the name of the file no longer appears when you give the DIRECTORY command. To see which files are archived, and which files are marked for archiving, give the subcommand ARCHIVE to the DIRECTORY command. The files that are already archived will have the comment ;OFFLINE next to the filename.

        @DIRECTORY,
        @@ARCHIVE
        @@

           PS:<SARTINI>

         CHAPT21.TCT.1;OFFLINE
         CHECK.TXT.1

         Total of 2 files

When you mark a file for archiving, you cannot modify, delete, or copy the file. The file does not appear in your directory unless you include the ARCHIVE subcommand in the DIRECTORY command.

top

6.13.3 Canceling an Archive Request

If you decide that you do not want to archive the file, give the CANCEL command to remove the archival request. You can give the CANCEL command as long as the file is still in archival request status, that is, as long as the INFORMATION ARCHIVE-STATUS command shows that archive is requested but not completed.

        @CANCEL (REQUEST TYPE) ARCHIVE (FOR FILES) CHECK.TXT
         CHECK.TXT.1 [OK]

top

6.13.4 Retrieving an Archived File

Once a file is archived, it is stored off-line on magnetic tape. If you need to use the file again, give the RETRIEVE command. The RETRIEVE command notifies the system that you are requesting the restoration of the file from off-line storage. To actually restore the file, the operator mounts the magnetic tape containing the archived file, and moves the file to your directory on disk.

        @RETRIEVE (FILES) CHAP21.TCT
         CHAP21.TCT.1 [OK]

To see your retrieval request, give the INFORMATION RETRIEVAL-REQUESTS command. The system prints a list of the requests in the retrieval queue.

        @INFORMATION (ABOUT) RETRIEVAL-REQUESTS

        Retrieval Queue:
         Name   Req#    Tape 1  Tape 2  User
        ------  ----    ------  ------  ---------------------
        CHAP21    48      5520    5543  SARTINI
        There is 1 job in the queue (none in progress)

Once your archived file is restored to disk, you must copy its contents to a new file before you modify it. You must use a copy of the file because you cannot alter an archived file in any way, even after it is restored to disk.

You can cancel any retrieval requests before the archived file contents are restored to disk, by using the CANCEL RETRIEVE command.

        @CANCEL (REQUEST TYPE) RETRIEVE (ID) CHAP21
        [1 Job Canceled]

top

6.13.5 Deleting an Archived File

If you decide that you will never need the tape copy of an archived file, delete the file with the DISCARD command. The DISCARD command does not delete the file itself, but it deletes the pointer from your directory to the file copy on tape. The tape copy of the file is actually deleted when the operator recycles tapes that contain files that have passed their expiration dates and/or have their pointers deleted.

After you give the DISCARD command, the operator sends you a mail message that contains information about the discarded file. If you wish to use the tape copy, you may be able to recover it using this information, as long as the tape has not yet been recycled.

If you have a disk copy of an archived file, the DISCARD command restores this file to its normal status.

top

6.13.6 Archiving Expired Files Automatically

There are several dates associated with each file you create. One of these dates is the on-line expiration date, which determines when a file's disk contents may be automatically moved to off-line storage. The SET DIRECTORY ARCHIVE-ONLINE-EXPIRED-FILES command enables this automatic archiving. This command is discussed at the end of the section.

On-line expiration dates are displayed with the DIRECTORY command:

        @DIRECTORY (OF FILES) ,
        @@DATES (OF) ONLINE-EXPIRATION
        @@

          PS:<TUCKER.USER>
          Online expiration

          ARCHIV.MEM.4      3-May-88          
            .QNO.15         5-May-88          
            .RNO.15         21-Nov-88          
          COMAND.CMD.5      21-Nov-88          
          MEMO.INI.1        8-Apr-88          
          USER.RNO.2        8-Apr-88          

          Total of 6 files

The system manager establishes a systemwide on-line expiration date, but you can override the system default with the SET DIRECTORY ONLINE-EXPIRATION-DEFAULT command:

        @SET DIRECTORY ONLINE-EXPIRATION-DEFAULT (OF DIRECTORY) -
        <TUCKER> (TO) 26-NOV-88

You can specify a time interval rather than a specific date:

        @SET DIRECTORY ONLINE-EXPIRATION-DEFAULT (OF DIRECTORY) -
        <TUCKER> (TO) +30

The command above sets the on-line expiration date to 30 days from the creation date.

You can also establish on-line expiration dates for individual files:

        @SET FILE ONLINE-EXPIRATION (OF FILES) MEMO.INI (TO) +120
        MEMO.INI.1 [OK]

If you want a file to be immediately available for archiving, give the SET FILE EXPIRED command:

        @SET FILE EXPIRED (FILES) PENDING.Q
        PENDING.Q.11 [OK]

The command above sets the expiration date to today's date.

When you are satisfied with the on-line expiration dates for your files, you can indicate that the system is to mark them for archiving when the expiration dates are reached:

        @SET DIRECTORY ARCHIVE-ONLINE-EXPIRED-FILES (OF DIRECTORY) - 
         <TUCKER>

You also have the choice of leaving expired files in your directory until a possible forced migration:

        @SET DIRECTORY NO ARCHIVE-ONLINE-EXPIRED-FILES (OF DIRECTORY) - 
         <TUCKER>

This is the default setting for directories.

To see if expired files in your directory will be automatically archived, give the INFORMATION DIRECTORY command:

        @INFORMATION (ABOUT) DIRECTORY (DIRECTORY NAME) <TUCKER>
        Name PS:<TUCKER>
             .
             .
        Archive online expired files
             .
             .

The line "Archive online expired files" indicates that automatic archiving will take place. If the SET DIRECTORY NO ARCHIVE-ONLINE-EXPIRED-FILES command is in effect, this line does not appear in the information display.

top

6.14 Visible and invisible files

Typically, you will have files that are not currently in use and cluttering your directory. You can clean up a directory by moving the files to tape (archiving), or to other directories, or by making your infrequently used files invisible.

An invisible file is not displayed by a simple DIRECTORY command and is not accessible to programs and EXEC commands. The ARCHIVE command automatically makes files invisible. When you RETRIEVE archived files, they will remain invisible when restored to disk.

To make a file invisible, use the SET FILE INVISIBLE command. To make an invisible file visible again, use the SET FILE VISIBLE command. To display your invisible files, use the DIRECTORY command with the INVISIBLE subcommand.

top