Document revision date: 30 March 2001 | |
Previous | Contents | Index |
When you access a file on a remote node, DECnet logs in at the remote node. To do this, the system needs login information for that node. You can supply the system with an access control string. If you omit the access control string, the login information sent to the remote node is determined as follows:
If you include an access control string, the system uses it to log you in to the remote node. The remainder of the file specification is passed to the remote node and is interpreted there.
If you specify a local node as part of a file specification, the system logs you in over the network to perform the file operation, even though the file exists on your local node. For information about additional ways to access remote systems, see the OpenVMS System Manager's Manual.
Throughout the remainder of this chapter, examples that specify a node name do not always include an access control string. This is because proxy accounts enable users to perform operations on the remote systems in these examples. |
Compaq TCP/IP Services for OpenVMS provides the File Transfer Protocol
(FTP) to access and transfer files to and from another host over a
network. To use FTP, you need a user account on the OpenVMS system with
access to Compaq TCP/IP Services for OpenVMS and a user account on the
remote FTP host. In some instances, TCP/IP allows you to connect to a
remote host without specifying an account and password. If that feature
is not enabled, you must supply user authentication information for a
remote host. For information on using FTP commands, refer to the
Digital TCP/IP Services for OpenVMS User's Guide.
4.1.11 Using Network File Specifications
There are three formats for network file specifications:
In each format, the node specification can include an access control
string. For more information, see the DECnet User's Manual for
your product and the Digital TCP/IP Services for OpenVMS User's
Guide.
4.1.11.1 Conventional File Specification
The conventional format for files is:
node::device:[directory]filename.type;version |
4.1.11.2 Foreign File Specification
A foreign file specification is a file that does not conform to OpenVMS syntax. The format used to provide a foreign file specification is:
node::"foreign-file-spec-string" |
In the following example, this file name contains a question mark (?), which is not recognized as a valid file name character. Therefore, the file name must be enclosed in quotation marks (" "). It must also be in a format that is recognized by the operating system of the remote node you are accessing:
$ COPY BOSTON::"TEST?.DAT" * |
A task specification string identifies a program to be executed on the remote node. You can use task specification strings within a program to enable the program to communicate with another program on a remote node. The format used to indicate a task specification string is:
node::"task-spec-string" |
This specification identifies the program TEST2 on the remote node BOSTON:
BOSTON::"TASK=TEST2" |
There are some restrictions when you copy files to or from an ULTRIX system. For more information, see the OpenVMS Record Management Utilities Reference Manual. |
Access control strings designate accounts that you can log in to on remote nodes. Node names with access control strings have the following format:
node"access-control-string":: |
Enclose the access control string in quotation marks (" ") and follow it with a double colon (::).
On OpenVMS systems, the access control string consists of a user name, followed by one or more spaces or tabs and a password. For additional information on access control strings, see Chapter 19.
In the following example, BOSTON is the network node name. "HIGGINS ETUHCARAP" is an access control string where:
$ DIR BOSTON"HIGGINS ETUHCARAP"::WEASEL2:[BORIS]ACCOUNTS.DAT |
Use wildcard characters to apply a DCL command to multiple files rather than to one file at a time. The command applies to all files that match the portion of the file specification entered.
Many examples in this chapter show the use of wildcard characters in file operations. The use of wildcard characters in DCL commands varies with the individual command.
There are two wildcards available for use with many DCL commands: asterisks (*) and percent signs (%). Both can be used as wildcard characters in directory names, file names, and file types. (See Section 5.5 for information about wildcards used with directories.) In version components, you can use an asterisk (;*), but not a percent sign or a mix of wildcards and numerals.
On Alpha systems running OpenVMS Version 7.2 or greater, the question mark (?) can be used in place of the percent sign (%).
If you are working in an environment with Extended File Specifications,
refer to the OpenVMS Guide to Extended File Specifications for information about additional wildcard
options.
4.2.1 Asterisk (*) Wildcard Character
Use the asterisk (*) wildcard character to match the following:
You can use the asterisk (*) wildcard character as follows:
$ PRINT [FROGMAN]*.*;* |
$ TYPE *.DAT;* |
$ DIRECTORY [FROGMAN.*]*.DAT |
$ TYPE [*.*.*]AVERAGE.*;* |
Use the percent sign (%) wildcard character as a substitute for any single character in a file specification. You can use the percent sign in the directory, file name, and file type fields. You cannot, however, use the percent sign in the version number field or in ANSI magnetic tape file specifications. The percent sign replaces one character position in a field, but there must be a character to replace.
You can specify the percent sign as many times as necessary and in combination with other wildcard characters.
The following example displays the latest versions of all .DAT files whose names are DISTRICT followed by a single character:
$ TYPE [JONES.TAXES.PROPERTY]DISTRICT%.DAT |
This display would include the files DISTRICT1.DAT, DISTRICT2.DAT, and DISTRICT3.DAT. The file DISTRICT4_5.DAT would not be displayed because it has more than one character after DISTRICT, nor would the file DISTRICT.DAT be displayed.
The file specification in this example is valid:
$ [MA*]INS%%%A*.J*;* |
The following sections describe other types of file names supported in
an OpenVMS environment.
4.3.1 Null File Names and File Types
When a file specification component, such as the file name or the file
type, is missing, it is often replaced by a default value during the
(built-in) parsing operation of the DCL command or utility. For
example, the FORTRAN command uses a default file type or .FOR. The
following command would cause the FORTRAN compiler to attempt to
compile the file FILE.FOR:
$ FORTRAN FILE |
Also, the DIRECTORY command replaces any missing components with an asterisk wildcard. For example, the following command would display all files with the file name FILE, no matter what file type (including a period (.)):
$ DIRECTORY FILE |
A file can have a name that is null or have a file type that consists of only the delimiter period (which is sometimes referred to as a null file type). For example, the following are valid file names:
.TMP TEMP. |
You can make a reference to a file with a type that consists of only the delimiter period, as follows:
$ DIRECTORY TEMP. ! |
Because there is no file name delimiter, it is not possible to make a reference to a file with a null file name. A file reference with no file name will always be interpreted as having a missing file name.
The following command will display a list of all files with the type .TMP rather than only the file .TMP because the directory utility will automatically replace the missing file name with "*".
$ DIRECTORY .TMP |
In addition to standard (ODS-2 compatible) file names, the operating system supports an alternate file-naming convention for ANSI-labeled magnetic tapes. The format is as follows:
"filename".;version |
The file name can contain 1 to 17 characters from the ASCII "a" character set. This set of characters includes numeric characters, uppercase letters, and a space, as well as the following characters:
! " % ' ( ) * + , - . / : ; < => ? & _ |
In addition, asterisk (*) character is allowed in ANSI magnetic tape file names.
For details, refer to the Guide to OpenVMS File Applications.
4.4 Creating and Modifying Files
The following sections describe how to create and modify files with tools and commands supported in an OpenVMS environment.
The most versatile interactive tool for creating and modifying text files is the interactive text editor. EVE and EDT are two text editors that are included in the OpenVMS operating system; other text editors may also be available on your system.
You can also create and modify files by using the DCL commands CREATE, COPY, and RENAME. The following sections describe how to create and modify files using these commands.
If you are working in an environment with Extended File Specifications,
refer to the OpenVMS Guide to Extended File Specifications for further information about creating and
copying files in your environment.
4.4.1 Creating Files
The CREATE command creates a text file. You cannot modify a file with the CREATE command; after you have pressed Return, you cannot return to a previous line to modify a word. You must use a text editor such as EDT or EVE to modify a file created with the CREATE command. Pressing Ctrl/Z signals the end of the file and returns you to DCL command level.
In the following example, a file named POUND.LIS is created by entering the CREATE command and then typing lines of text:
$ CREATE POUND.LIS Tag #23, Elmer Doolittle, notified Tag #37, James Watson, notified No tag, light brown, 30 lbs., looks part beagle [Ctrl/Z] |
You can use the COPY command to duplicate:
$ COPY FEES.DAT RECORDS.DAT |
$ COPY *.TXT;* [SAVETEXT]*.*;* |
$ COPY/SINCE=11-DEC-1999/MODIFIED [JONES.LICENSES.DOG]*.* * |
The COPY command can also be used to concatenate files. For example, to append FEES1.DAT to FEES.DAT (forming a new version of FEES.DAT) in your default directory, enter the following command:
$ COPY FEES.DAT,FEES1.DAT FEES.DAT |
Note that there is no space between the comma after FEES.DAT and the
file name FEES1.DAT.
4.4.4 Copying Files from a Remote Node to Your Node Using DECnet
Use the COPY command to copy files from another node to your node. For example, to copy the latest version of all files in the directory DISK2:[PUBLIC] on node CHAOS to files with the same names in your default directory, enter the following command:
$ COPY CHAOS::DISK2:[PUBLIC]*.* * |
Use the COPY command to copy files from your node to another node. If you receive a protection violation or DECnet error message when you attempt to copy a file across systems, you can either use mail to copy the file or you can use an access control string.
In the following example, the latest version of all files in the default directory are copied to files with the same names in the directory DISK2:[STAFF_BACKUP] on node CHAOS:
$ COPY *.* CHAOS::DISK2:[STAFF_BACKUP] |
When copying to and from remote nodes in a cluster of mixed environments (nodes with Extended File Specifications and nodes without Extended File Specifications), be aware that extended file names and special characters may not copy as expected. Refer to the OpenVMS Guide to Extended File Specifications for more information. |
TCP/IP uses the File Transfer Protocol (FTP) service to access and
transfer files to and from another host over a network. To copy files
from a remote host to your local host, use the GET command. To copy
files from your local host to a remote host, use the PUT command. To
use these commands, you must have an active FTP session with a remote
host. You can enter any number of FTP commands during the session. For
information on using FTP commands, refer to the Digital TCP/IP
Services for OpenVMS User's Guide.
4.4.7 Using Mail to Copy Files
If the file is yours, you can use Mail to send it to a user account on the other node.
When sending files though mail, note the following restrictions:
For more information on using Mail to send files, see Chapter 6.
In the following example, the file FEES.DAT is sent to the JONES account on node CHAOS:
$ MAIL/SUBJECT="Fee schedule" FEES.DAT CHAOS::JONES |
To copy files after you have received a protection violation, you can follow the node name in the file specification with an access control string (see Section 4.1.12).
In the following example, the user has an account on node CHAOS with the user name SMITH and the password SPG96PRT. The user is copying the latest version of all files in the default directory to the account on CHAOS.
$ COPY *.* CHAOS"SMITH SPG96PRT"::DISK2:[STAFF_BACKUP] |
Use the RENAME command to give the file a new name and optionally to locate it in a different directory. Note that after being renamed, the original file no longer exists. When you use the RENAME command, the input and output locations must be on the same device.
In the following example, the file FEES.DAT is given the new name RECORDS.DAT and it is moved from the default directory to the [SAVETEXT] directory:
$ RENAME FEES.DAT;4 [SAVETEXT]RECORDS.DAT |
The following sections describe how to display the contents of files
with tools and commands supported in an OpenVMS environment.
4.5.1 Using the TYPE Command
To display the contents of a file on your screen, enter the TYPE command and the file name at the DCL prompt. You do not have to specify the version number in the file specification because the system displays the latest version of a file by default.
In the following example, the latest version of the file STAFF_VACATIONS.TXT is displayed:
$ TYPE STAFF_VACATIONS.TXT |
To stop the scrolling of the text on the screen temporarily, press the Hold Screen key (F1 on VT200 and VT300 series terminals); to resume scrolling, press the Hold Screen key again. To stop the display and return to DCL command level, press Ctrl/Y or Ctrl/O.
If you specify the /PAGE qualifier to the TYPE command, you can view one screen at a time. The system prompts you to press Return when you want to see the next screen.
Previous | Next | Contents | Index |
privacy and legal statement | ||
6489PRO_008.HTML |