Document revision date: 15 July 2002
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS System Manager's Manual


Previous Contents Index

10.7.4.1 Changing Directory UIC Protection Characteristics

The DCL command SET DIRECTORY modifies the characteristics of one or more directories.

Example


$ SET DIRECTORY/OWNER_UIC=[360,020] [DAVIS],[USERS]

The SET DIRECTORY command in this example modifies both the [DAVIS] and [USERS] directories, changing their owner UICs. Using the /OWNER_UIC qualifier requires SYSPRV (system privilege).

10.7.4.2 Changing Default ACL Protection

You can override default UIC protection for specified directories or subdirectories by placing a default protection ACE in the ACL of the appropriate directory file. The default protection specified in the ACE is applied to any new file created in the specified directory or in any subdirectory of the directory.

Example

The following ACE, which must be in the ACL of a directory file, specifies that the default protection (for files created in the directory and its subdirectories) will allow system and owner processes full access, group processes read and execute access, and world users no access:


(DEFAULT_PROTECTION,S:RWED,O:RWED,G:RE,W:) 

10.7.5 Protecting Magnetic Tape Files

Because tapes are single-user devices, tape protection is only at the volume level. The protection codes for magnetic tape volumes are usually assigned with the INITIALIZE command.

You cannot use DCL commands to change protection characteristics on magnetic tape volumes. See Section 9.5.1 for more information.

10.8 Accessing Disk Files

This section describes how to use DCL commands to access files at the file level, not at the record level. This applies to reading files on disks, which is explained in this section, as well as to copying tape files, which is explained in Section 10.10.1.

Although DCL does allow you to manipulate files at the record level, for reasons of performance, you probably want to use a conventional programming language instead. Compaq recommends that you write programs using the OpenVMS Record Management Services (RMS) facilities, which are specifically designed to access files at the record level. You can write these programs in any higher-level language that the operating system supports.

To access disk files at the file level, you can use DCL commands. You cannot, however, use DCL commands to read or write files that are not in the standard formats supported by the operating system. If the file formats are not standard, you must mount the volumes on which they reside with the /FOREIGN qualifier to have read and write access.

Although the examples used in this section show how to access disk files on RA90 disk packs, they also apply to other devices.

To read the contents of a disk file, use the DCL command TYPE, which displays the contents of a file on your terminal. To find the exact location of the disk file you want to read, use the DCL command DIRECTORY.

How to Perform This Task

If, for example, you want to read the contents of a file named HISFILE, which is located somewhere in the directory [CHARLES] on a disk device whose logical name is DISK$DOCUMENT, follow these steps:

  1. Look for the exact location of HISFILE by entering the following command:


    $ DIRECTORY DISK$DOCUMENT:[CHARLES...]HISFILE.*
    

    This command instructs the operating system to search the entire [CHARLES] directory, including all the subdirectories, for all file types and version numbers of HISFILE.
    The following information is displayed on your terminal:


    Directory DISK$DOCUMENT:[CHARLES.MEMO]
    HISFILE.UPD;1
    Total of 1 file.
    

    This display informs you that only one version of HISFILE exists, that its file type is UPD, and that it resides in the [CHARLES.MEMO] directory.

  2. To read the contents of this file, enter the following command:


    $ TYPE [CHARLES.MEMO]HISFILE.UPD
    

    The contents of HISFILE are displayed on your terminal.

10.9 Accessing Tape Files

This section describes file-level access for tapes. When you request access to a standard-labeled volume or a file, the operating system checks at the volume and file level to ensure that your process can access the volume or file. The level at which the system checks access depends on the operation you request and the type of access the operation requires.

When you access a volume or a file, the operating system software reads the volume- and file-header labels to determine whether access to the volume or file is restricted. Which label is read depends on the operation requested. For example, if you want to mount a volume, your process must have access to it.

The protection set on a file determines your access to the file. The expiration date field in the header can prevent you from overwriting or appending to a file immediately preceding the one in question. If the expiration date field has not been reached, a file has not expired.

To overwrite an unexpired file, you must specify the /OVERRIDE=EXPIRATION qualifier when you mount the volume. Performing this operation requires that you have read or write access.

After a section that explains tape file names are sections that tell how to perform these tasks:
Task Section
Locate standard-labeled tape files Section 10.9.2
Use wildcards with tape files Section 10.9.3
Read files on tape volumes Section 10.9.4
Write files to tape volumes Section 10.9.5

10.9.1 Understanding Tape File Names

OpenVMS systems accept two types of file names for magnetic tapes:

Table 10-6 compares characteristics of OpenVMS extended names and standard names.

Table 10-6 Comparison of OpenVMS Extended Names and Standard Names
Characteristic OpenVMS Extended Names Standard Names
Valid with... Tape and disk volumes Tape volumes
Format filename.type;version filename.;version ( Version is optional.)
Length 39.39; 17.;
Valid Characters A through Z; 0 through 9; ampersand (&), hyphen (-), underscore ( _ ), and dollar sign ($); wildcard characters asterisk (*) and percent sign (%) ASCII "a" 7 characters enclosed in quotation marks (" "). Note that within a file name, DCL interprets a double set of quotation marks ("") as a single set ("). If a name has fewer than 17 characters, the system pads the name on the right with spaces to arrive at the 17-character maximum length.
Examples OPENVMS_FILENAME.DAT;23 "GENLABEL#123";2


7The ASCII "a" character set is defined in Clause 7.4.1 of the ISO 9660 Standard.

10.9.2 Locating Standard-Labeled Tape Files

Before accessing a particular file for a read or write operation, you might want to search the magnetic tape volume for that file. Use the DCL command DIRECTORY to locate a file or group of files on a tape volume.

When you specify a file name for a file residing on tape, the tape file system performs the following tasks:

  1. Compares the file name with the file header labels of each file until it finds a match in the file identifier field of the file header labels.
  2. The system selects the first file on the magnetic tape whose file name in the file identifier field matches the specified file name.
    The operating system supports neither the directory nor the latest version number concept for magnetic tape volumes. The system does not search for or list the latest version of a specified file. The magnetic tape file system cannot increment version numbers of files written to tape; therefore, two or more files in the same volume set can have the same file name and version number.
    Because the tape file system selects the first matching file name and version number (if specified), the position of the magnetic tape within the volume set determines which file is returned on a search operation. A search operation begins at the current position, so you might want to rewind the volume set before accessing a file.
  3. The search for a matching file and version number (if specified) continues at the beginning of the header-label set of the next file. The search ends when the magnetic tape is positioned at the file where the search began.
    If the system does not find the requested file on the current volume, it searches the remaining volumes in the volume set sequentially and then searches from the beginning of the first volume of the volume set. If the system still does not find the file name, it reports an error.

10.9.3 Using Wildcard Characters with Tape Volumes

The OpenVMS operating system supports a limited use of wildcard characters in file specifications for tape volumes.

Table 10-7 explains the use of wildcard characters with OpenVMS extended names and with standard names.

Table 10-7 Wildcard Character Support with Tape Volumes
Wildcard Character OpenVMS Extended Names Standard Names Description
Asterisk (*) X X In OpenVMS extended names, you can use an asterisk anywhere in the file name and file type field to match a field or portion of a field. You can also use the asterisk in the version number field.

In standard names, you can use only a single asterisk in a field.

Percent sign (%) X   In OpenVMS extended names, you can use a percent sign in a file specification only to match character positions within a field. You cannot use the percent sign in the version number field.

Unlike OpenVMS extended names, which can consist of up to 39 characters each for the file name and file type, standard names can have a maximum of 17 characters.

The following examples show how to use wildcard characters in file specifications to search for files on tape volumes. These examples also show how you can use the DIRECTORY command with tapes. Note that the DIRECTORY command does not work the same with tape files as with disk files.

Examples


  1. $ DIRECTORY MFA1:*.*;*
    

    This command instructs the system to search a volume set. Because asterisks are used in the file specification and the asterisk is a valid wildcard character for both standard and OpenVMS extended names, the system returns both OpenVMS extended names and standard names. Note that the system returns tape file names within quotation marks.


  2. $ DIRECTORY MTA1:%*.*;*
    $ DIRECTORY MTA0:*.%*;*
    

    In these two commands, the search can match only with OpenVMS extended names because the percent sign is not valid for standard names. In the second command, the file type field must contain at least one character. Files with no file type are not returned.


  3. $ DIRECTORY MTA0:*.;*
    

    In this example, the DIRECTORY command instructs the system to search for files with both standard names and OpenVMS extended names that do not have a file type.

10.9.4 Reading Files on Tape Volumes

When you access a tape file for a read operation, the tape is positioned at the beginning of the file section after the file header labels. When you access a file residing on a tape volume only to read the attributes in the header labels (rather than the data in the file section), the tape file system returns the RMS attributes to your process. For example, when you specify the DIRECTORY/FULL command for a volume, file, or list of files, the tape file system performs the following tasks:

  1. Selects the file identifiers from the header labels
  2. Returns the file attributes to your process
  3. Positions the tape after the header labels of the last file accessed

A tape file opened for read access is closed in either of the following ways:
Method Description
Implicitly The file is closed implicitly when the drive encounters a tape mark while the system reads a file. The tape file system then reads the trailer labels, closes the file, and positions the tape at the next file.
Explicitly The file is closed explicitly when you finish accessing the file before all the data in the file is read. The tape file system then closes the file without reading the trailer labels, and the tape remains at the current position.

Example

Use the DCL command TYPE to read a file or group of files on the tape volume and to display the contents of the file on your terminal. For example, if you want to read the contents of a file named TESTFILE.DOC;1 (which you know from your directory searches is an OpenVMS file residing on the tape volume MTA1:), enter the following command:


$ TYPE MTA1:TEST*.%*;*

You then receive the following display on your terminal:


MTA1:TESTFILE.DOC;1 
 
This is a test file. 

10.9.5 Writing Files to Tape Volumes

When you write files to a tape volume, the tape file system performs access checks, writes labels, and, if necessary, switches volumes.

10.9.5.1 Writing New Files That Overwrite Existing Files

If a new file will overwrite an existing file, the tape file system performs the following tasks:

  1. Checks the expiration date and accessibility fields of the existing file.
  2. If overwriting is allowed, the tape file system performs the following task:
    1. Overwrites the header label set of the existing file
    2. Creates the file section
    3. Writes the trailer labels
    4. Writes two tape marks to denote the logical end-of-volume (EOV)

All files following the newly created file are lost.

To close a tape file that was opened for write access, the tape file system issues commands to the driver to write the labels, followed by a double tape mark that indicates the logical EOV.

10.9.5.2 Appending or Updating Files

When you use DCL to access an existing file for a write operation, either an append or an update operation is actually performed. The following table describes each operation.
Access Method Description
Append When you access a file for an append operation, the tape is positioned before the tape mark that precedes the trailer labels. After the file is appended and closed, all files beyond the appended file are lost. When the positioning is complete, the processing is handled as if the file had been created.
Update When you access a file for an update operation, the tape is positioned after the tape mark that follows the header labels. After the file is written to and closed, all files beyond the updated file are lost. The processing is handled as if the file had been created.

Note that you can update or append tape files only when the header label contains a value of 0 for the buffer offset length. For more information about how to update and append tape files, see Section 10.10.

If you do not specify the /OVERRIDE=EXPIRATION qualifier when you update a file, the tape file system checks the expiration date field on the file before it allows you to write to that file.

In addition, before you append a file, the tape file system checks the expiration dates of both the file being appended and the file immediately following it. If the expiration date of either file has not been reached, the magnetic tape file system does not allow you to append the file.

Example

You can use the CREATE command to access a volume for a write operation. The following CREATE command writes a new file to the tape volume:


$ CREATE MTA0:MYFILE

After entering a command similar to the one in this example, follow these steps:

  1. Enter the contents of the file.
  2. Press Ctrl/Z to close the file and write it to the tape volume without leaving the DCL command level.

10.10 Copying and Transferring Files

With the OpenVMS operating system, you can copy files on disks and tapes both within the system and across other operating systems. The OpenVMS operating system provides a number of facilities to assist you in both types of information transfer.

Table 10-8 summarizes the methods you can use to transfer information.

Table 10-8 Methods of Transferring Information
Method Description
DCL command COPY Most frequently used method for transferring information.
Convert utility (CONVERT) On a local system, allows you to change the organization of a file from sequential to indexed, for example.
Exchange utility (EXCHANGE) On a local system, allows you to access disk and tape volumes that are formatted for operating systems other than OpenVMS. You can use EXCHANGE to transfer files between foreign volumes and standard Files--11 volumes.
DCL command EXCHANGE/NETWORK Allows you to transfer files via the network between OpenVMS and other operating systems. The command is useful for transferring files between nodes that use OpenVMS and those that do not. The file is copied in such a way that it is meaningful on OpenVMS and other operating systems as well.
Backup utility (BACKUP) With tapes, the only means of copying entire directory trees or files that are not sequentially structured. See Section 11.13.2 for information about using BACKUP to copy files.
CDRECORD.COM Lets you transfer files to a CD-R disk to create your own CD-ROM. Available on some AlphaServers.

The COPY command, the Exchange utility, the DCL command EXCHANGE/NETWORK, and CDRECORD.COM are explained in the following sections.

In many cases, you can copy information without physically transporting media. Perhaps you want to copy files between systems that are not connected by a communications link. If so, you must be able to move your files physically from one location to another. A convenient way is to copy your files to a portable volume, such as a tape reel, tape cartridge, or disk pack, and then carry that volume to the location of the other system.

The following sections describe how to perform these tasks:
Task Section
Copy files to disk volumes Section 10.10.1
Copy files to tape volumes Section 10.10.2
Continue to copy at the end of a tape Section 10.10.3
Use the Exchange utility to copy files Section 10.10.4
Use the DCL command EXCHANGE/NETWORK to transfer files over a network Section 10.10.5
Use CDRECORD.COM to create a CD-ROM Section 10.11


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
6017PRO_043.HTML