Document revision date: 15 July 2002 | |
Previous | Contents | Index |
The DCL command SET DIRECTORY modifies the characteristics of one or more directories.
$ 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.
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:) |
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.
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:
$ DIRECTORY DISK$DOCUMENT:[CHARLES...]HISFILE.* |
Directory DISK$DOCUMENT:[CHARLES.MEMO] HISFILE.UPD;1 Total of 1 file. |
$ TYPE [CHARLES.MEMO]HISFILE.UPD |
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 |
OpenVMS systems accept two types of file names for magnetic tapes:
Table 10-6 compares characteristics 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 |
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:
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.
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.
$ DIRECTORY MFA1:*.*;* |
$ DIRECTORY MTA1:%*.*;* $ DIRECTORY MTA0:*.%*;* |
$ DIRECTORY MTA0:*.;* |
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:
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. |
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. |
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:
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.
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:
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.
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 |
privacy and legal statement | ||
6017PRO_043.HTML |