HP OpenVMS Systems Documentation

Content starts here

OpenVMS User's Manual


Previous Contents Index

4.3.1 Setting Default to Nonexistent Directories

Note that the operating system allows you to set default to a nonexistent disk or directory. If you have set default to a nonexistent directory, when you try to manipulate a file, the system displays a message stating that the directory does not exist. If you find yourself in a nonexistent disk or directory and cannot carry out a desired operation, set default to an existing disk or directory.

4.3.2 SHOW DEFAULT Command

To display your current default directory, enter the command SHOW DEFAULT, as shown in the following example:


$ SHOW DEFAULT
  DISK1:[JONES.TAXES]
$ SET DEFAULT [PUBLIC]
$ SHOW DEFAULT
  DISK1:[PUBLIC]

You can use the SET DEFAULT command to change the default device. The default remains in effect until you enter another SET DEFAULT command or log out. You can also specify the device to which you want to set default without including the directory in the command.

The following example shows how to change the default device:


$ SHOW DEFAULT
  DISK1:[JONES]
$ SET DEFAULT DISK2:[GROUP]
$ SHOW DEFAULT
  DISK2:[GROUP]

In the following example, the directory [JONES] is assumed and exists on DISK1 and DISK2:


$ SHOW DEFAULT
  DISK1:[JONES]
$ SET DEFAULT DISK2:
$ SHOW DEFAULT
  DISK2:[JONES]

4.3.3 Using Temporary Defaults

If you enter a list of files and do not give a complete file specification for each file in the list, the system applies temporary defaults for node names, device names, and directory names. To substitute your current default directory for a temporary default, use empty square brackets. If you include a node name in a file that appears in a list, you can override the temporary default by using a double colon.

In the following example, A.LIS and B.LIS are copied from the [STATS] directory to the [RESULTS] directory:


$  COPY [STATS]A.LIS,B.LIS  [RESULTS]

Note that the system uses the preceding file specification in the list, [STATS]A.LIS, to determine that the temporary default directory for file B.LIS is [STATS] as well.

In the following example, a temporary default device and two different directories are used:


$  COPY BASE:[STATS]A.LIS,[TIME]B.LIS,C.LIS  [RESULTS]

All three files (A.LIS, B.LIS, and C.LIS) are copied from the BASE device. The A.LIS file is copied from the [STATS] directory. The other two files are copied from the [TIME] directory.

In the following example, the current default directory is [BETA]. This command copies [ALPHA]TEST.DAT and [BETA]FINAL.DAT to the [RESULTS] directory:


$  COPY [ALPHA]TEST.DAT,[]FINAL.DAT  [RESULTS]

4.4 Protecting Directories from Other Users

You cannot completely protect a file without applying at least the same protection to the directory in which the file resides. For example, if you deny a user all access to a file but allow that user read access to the file's directory, the user cannot access the contents of the file but can see that it exists. Conversely, a user allowed access to a file and denied access to the file's directory (or one of the parent directories) cannot see that the file exists.

Note

To protect private files, directory protection alone is not adequate. You must also protect each file within the directory.

By default, top-level directories receive UIC-based protection (S:RWE,O:RWE,G:RE,W:E) and no ACL. Subdirectories receive UIC-based protection from the parent directory. For more information on protection codes, see Section 10.3.

To specify UIC-based protection explicitly when creating a directory, use the /PROTECTION qualifier with the CREATE/DIRECTORY command. You cannot specify an ACL for the directory until the directory is created. To change the UIC-based protection of an existing directory, apply the SET SECURITY/PROTECTION command to the directory file.

You can limit but not prohibit directory access by specifying execute access but not read access. Execute access on a directory permits you to examine and read files that you know are contained in the directory; that means you can examine a file if you already know what the file specification is, but you cannot display a list of the files in the directory. For additional security information, refer to the OpenVMS Guide to System Security.

4.5 Using Wildcards to Search the Directory Structure

From any point in a directory structure, you can refer to another directory or subdirectory in the structure. Do this by specifically naming the directory or subdirectory you want or by using the ellipsis (...) and hyphen (-) wildcard characters. For additional information about wildcards, see Section 3.2.

If you are working in an environment with extended file specifications, refer to Chapter 5 for further information about searching directory structures with wildcards.

4.5.1 Ellipsis Wildcard Character

Use the ellipsis (...) wildcard character to search down into the directory hierarchy. To search the current directory and all the subdirectories below it, use the ellipsis by itself as shown:


$ DIRECTORY [...]

If you begin the directory specification with an ellipsis, the search begins from your current directory. However, if you begin the directory specification with a period, only the subdirectory that is one level lower than the current directory is searched.

To search all top-level directories and their subdirectories from wherever you are in the directory structure, use an asterisk (*) followed by an ellipsis (...).

In the following example, assuming the current directory is [JONES], the latest versions of all files named FEES.DAT in [JONES] and all subdirectories under [JONES] will be displayed:


$ TYPE [JONES...]FEES.DAT

In the following example, assuming the current default directory is [JONES], all subdirectories that end in .SALES are searched, and the latest versions of the file FEDERAL.LIS are displayed:


$ TYPE [...SALES]FEDERAL.LIS

In the following example, the latest versions of all files named DEPT.DAT in [JONES] and all subdirectories under [JONES] are displayed:


$ TYPE [...]DEPT.DAT

In the following example, assuming the current directory is [JONES], the [.LICENSES] subdirectory will be searched for the file MAILING.LIS, but [JONES.LICENSES.MARRIAGE] will not:


$ TYPE [.LICENSES]MAILING.LIS

In the following example, assuming the current directory is [JONES], the latest versions of all files named DEPT.DAT in the [.LICENSES] subdirectory under [JONES] and all subdirectories under the [.LICENSES] subdirectory are displayed:


$ TYPE [...LICENSES...]DEPT.DAT

In the following example, as many as eight levels of directory names (the top-level directory and seven subdirectories) are searched (if they exist). Note that the command shown requires READALL privilege.


$ DIRECTORY [*...]

4.5.2 Hyphen (-) Subdirectory Character

Hyphen characters are used as an abbreviated way to specify [sub-]directories above the current process default directory. Each hyphen represents one level. Hyphens can be followed by subdirectory names (with separating periods) to specify other paths down the directory hierarchy.

If you enter so many hyphens that the reference points above the top-level directory, the system displays an error message.

In the following example, the current process default directory is [JONES.LICENSES]. The following command displays the latest version of STAFF.DIS in [JONES]:


$ TYPE [-]STAFF.DIS

In the following example, the current directory is [JONES.LICENSES]. The command shown displays the latest version of BILLING.DAT in [JONES.TAXES]:


$ TYPE [-.TAXES]BILLING.DAT

In the following example, the command shown changes the process default directory to one that is two levels above the current level in the directory hierarchy.


$ SET DEFAULT [--]

On OpenVMS Version 7.2 Alpha or later with ODS-5 disks, file names and subdirectory names can consist solely of hyphens. To distinguish between a (sub-)directory whose name consists of hyphens and a relative specification, the former must be specified with at least one RMS escape character (^). The following specification refers to the directory three levels above the current process default.


[---]

The following specification refers to the directory (UFD) "---":


[^---]

4.6 Working with Directories in UIC Format

Although this chapter focuses on how to use named directories, you can also specify directory names in UIC format. In UIC format, a 2-part octal number forms a user identification code (UIC) that refers to a user file directory (UFD). Almost every DCL command that accepts a file specification can recognize directory names in UIC format. In general, you do not need to use this format unless you are working with a real-time Resource Sharing Executive (RSX) operating system.

A UIC directory specification has the following format:


[group,member]

For example, [122,1] is a UIC directory specification representing member 1 in group 122. Directory names in UIC format generally, but not necessarily, correspond to the UIC of the owner of the directory.

When you refer to a UIC directory, observe the following rules:

  • Use an octal number in the range of 1 to 37776 to specify the group.
  • Use an octal number in the range of 0 to 177776 to specify the member.
  • Do not use the hyphen (-) or ellipsis (...) wildcard as part of the specification.

4.6.1 Using Wildcards with UIC Directories

It is also possible to use the asterisk (*) wildcard to specify a UIC directory. For example, [*,6] indicates all directories with any group number and a member number of 6. The search is limited to directories in UIC format. The directory specification [*,*] locates all directories in UIC format. To locate all named directories as well as all directories in UIC format, use [*].

4.6.2 Translating to Named from UIC Format

Note that you can translate a directory name in UIC format to named format. If necessary, add zeros to the left of the group and member numbers to create a 6-character name.

You cannot combine UIC format and named format. If you have a directory with a name in UIC format and you want to specify one of its subdirectories, translate the UIC format to named format.

The named equivalent of the UIC directory specification [122,1] is as follows:


[122001]

To refer to the subdirectory [122,1]SUB.DIR, use the named directory [122001.SUB].


Chapter 5
Extended File Specifications

OpenVMS Alpha Version 7.2 implemented Extended File Specifications, which consists of two major components:

  • An optional volume structure, On--Disk Structure Level 5 (ODS-5) that supports longer file names with a greater range of legal characters
  • Deep directories

Taken together, these components provide much greater flexibility for OpenVMS Alpha systems (using Advanced Server for OpenVMS) to store, manage, serve, and access files that have names similar to those in a Windows environment.

Deep directories and extended file names provide the following benefits:

  • OpenVMS users can make use of long file names, new character support, and the ability to have lowercase and mixed-case file names. These new capabilities make file activity on an OpenVMS file server more transparent to Windows users.
  • OpenVMS system managers can see files on OpenVMS systems with the names specified by Windows users.
  • Applications developers who are porting applications from other environments that have support for deep directories can use a parallel structure on OpenVMS.

5.1 ODS-5 Volume Structure

On--Disk Structure (ODS) refers to a logical stucture given to information stored on a disk. ODS-2 is the default disk structure of the OpenVMS operating system. ODS-5 is a superset of ODS-2 that is especially useful in multiplatform environments. The ODS-5 volume structure provides:

  • Long file names
  • More characters legal within file names
  • Preservation of case within file names

5.1.1 Long File Names

Traditional (ODS-2) file specifications follow the 39.39 format, supporting only a single period (.) separating the file name and file type.

On an ODS-5 volume, the file name together with the file type can be up to 236 8-bit characters, or 118 16-bit characters, in length.1 For example:


$ CREATE This.File.Name.Has.A.Lot.Of.Periods.DAT
$ CREATE -
_$ ThisIsAVeryLongFileName^&ItWillKeepGoingForLotsAndLotsOfCharacters.Exceed -
_$ ingThe39^,39presentInPreviousVersionsOfOpenVMS
$ DIRECTORY


Directory TEST$ODS5:[TESTING]

ThisIsAVeryLongFileName^&ItWillKeepGoingForLotsAndLotsOfCharacters.Exceeding
The39^,39presentInPreviousVersionsOfOpenVMS;1
This^.File^.Name^.Has^.A^.Lot^.Of^.Periods.DAT;1

Total of 2 files.

5.1.2 More Characters Legal Within File Names

Traditional (ODS-2-compliant) file names can use alphanumeric characters (A-Z, a-z, 0-9), the dollar sign ($), underscore (_) and hyphen (-). ODS-5 offers a broader set of characters for naming files.

ISO LATIN-1 and Unicode (UCS-2) Character Sets

ODS-5 supports file names that use the 8-bit ISO Latin-1 character and 16-bit Unicode (UCS-2) character sets. The ISO Latin-1 Multinational character set is a superset of the traditional ASCII character set. In extended file specifications, you can use all characters from the 8-bit ISO Latin-1 Multinational character set except the asterisk (*) and the question mark (?).

Special Characters

Some ISO Latin-1 characters require an escape character to precede them in a file specification in order to be interpreted correctly. In extended file names, RMS and DCL interpret the circumflex (^) as an escape character. The following list contains rules for using the escape character:

  • The escape character (^) followed by an underscore (_) or a space represents a space.
  • The escape character (^) followed by any of the following characters means that the character is to be used as part of a file name, rather than having any special meaning that it might otherwise have in a file specification:


    .  ,  ;  [  ]  %  ^  &
    
  • You can enter a literal period (.) with or without the escape character (^) in a file name. The system adds the escape character to any periods other than those that act as delimiters for the file type and version number. Literal periods (.) in directory names must be preceded by the escape character.
  • An escape character followed by a hexadecimal digit requires a second hexadecimal digit. Interpret the two following characters as a hexadecimal value for an arbitrary 1-byte character. For example, ^20 represents a space.
  • An escape character followed by "U" within a file specification indicates that the four hexadecimal digits that follow are to be interpreted as Unicode. For example, ^U012F.
    All characters in file specifications that are not preceded by an escape character (^) are presumed to be ISO Latin-1.

Note

File names containing special characters cannot be accessed from a VAX system. See Section 5.7 for more information about mixed-architecture environments.

Interpretation of Period (.)

The use of the period (.) as a literal character in extended file names requires RMS to determine which periods are file name characters and which are delimiters.

When only one period (.) is used in an extended file name, that period is interpreted as the delimiter. As in previous versions of OpenVMS, this behavior also occurs if the single period is followed by a number:


$ CREATE Test.1

creates the file:


Test.1;1

Determination of Version Numbers

When there are multiple periods (.) in a file name, RMS looks at all the characters after the last period.

If Then
The characters after the last period are all numeric The numeric string is determined to be a version number
The characters after the last period are all numeric and preceded by a minus sign (-) The numeric string is determined to be a version number
There are more than 5 numeric characters after the last period RMS rejects the file name as illegal
There is a nonnumeric character following the last period It is interpreted as a file type delimiter

For example, the following command:


$ CREATE Test4.3.2.1

creates the file:


Test4^.3.2;1

where 2 is the file type and 1 is the file version.

A version number explicitly delimited by a semicolon (;) must also be 5 or fewer numeric characters, and can be preceded by a minus sign (-).

5.1.3 Preservation of Case

In prior versions of OpenVMS, DCL, and RMS converted all file specifications to uppercase.

On ODS-5 volumes, you can enter file names in uppercase, lowercase, or mixed case. The case of all files names is preserved as created. For example:


$ CREATE KitContents.Txt

$ DIRECTORY

Directory  DISK1:[USER1]

KitContents.Txt;1

When you create multiple files with the same name differing only in case, DCL treats the subsequent files as new versions of the original file, and converts them to the same case as the original file. For example:


$ CREATE CaPri
$ CREATE CAPRI
$ CREATE capri
$ DIRECTORY

Directory  DISK1:[USER1]

CaPri.;1  CaPri.;2  CaPri.;3

5.1.4 Using Wildcards

Single- and multiple-character wildcards function as expected with ODS-5 files. A single-character wildcard represents exactly one character in either the file name or file type, but may not be used in the file version string. A multiple-character wildcard can represent any number of characters (including zero characters) in the file name or file type. A multiple-character wildcard can be used in place of a version string.

5.1.4.1 Wildcard Characters

The following characters are always valid wildcard characters:

  • The asterisk (*) is a multiple-character wildcard.
  • The percent sign (%) is a single-character wildcard.
  • The question mark (?) is a single-character wildcard.

The percent sign (%) continues to be a single-character wildcard to maintain compatibility with existing applications. The percent sign (%) may be used as a literal character when preceded by the circumflex (^) and is also a literal character in Windows file names. In addition to the percent sign, RMS also recognizes the question mark (?) as a single character wildcard. The question mark functions identically to the percent sign as a wildcard character on OpenVMS 7.2 and later. The percent sign and the question mark each matches exactly one character in a search pattern.

Note

An escaped character (such as ^.) or an escape sequence (such as ^EF or ^U0101) is considered a single character for purposes of wildcard matching.

Note

1 Unmodified programs and utilities may limit or abbreviate complete file specifications to 255 bytes.


Previous Next Contents Index