|
|
|
|
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
|
Locating Standard-Labeled Tape Files
|
Use wildcards
with tape files
|
Using Wildcard Characters with Tape Volumes
|
Read files
on tape volumes
|
Reading Files on Tape Volumes
|
Write files to tape volumes
|
Writing Files to Tape Volumes
|
Understanding Tape File Names
OpenVMS systems accept two types of file names for magnetic
tapes:
Comparison of OpenVMS Extended Names and Standard Names 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" characters
enclosed in quotation marks (" ").1 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
|
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:
Using Wildcard Characters with Tape Volumes
The
OpenVMS operating system supports a limited use of wildcard characters
in file specifications for tape volumes.
Wildcard Character Support with Tape Volumes explains the use of wildcard characters with OpenVMS extended names and with standard names.
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.
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.$
DIRECTORY MFA1:*.*;*
$
DIRECTORY MTA1:%*.*;*
$
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.$
DIRECTORY MTA0:*.;*
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:
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:
You then receive the following display on your terminal:$
TYPE MTA1:TEST*.%*;*
MTA1:TESTFILE.DOC;1 This is a test file.
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.
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.
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.
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 Copying and Transferring Files.
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:
After entering a command similar to the one in this example, follow these steps:$
CREATE MTA0:MYFILE
1 The ASCII "a" character set is defined in Clause 7.4.1 of the ISO 9660 Standard.
( Number takes you back )
|
|