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 commands during the session. You can also use the COPY/FTP command to copy files across the network using TCP/IP. For more information on this command, type HELP COPY/FTP at the DCL prompt. FTP resolves the differences between UNIX file systems and OpenVMS file systems automatically. By default, the PUT command copies files to UNIX systems using lowercase file names without version numbers. If you use a wildcard to copy all versions of a file and do not specify an output file, the following occurs: o The version numbers become the last element of the copied files. o Semicolons are converted to periods.
1 – Store Unique Feature
The Store Unique (STOU) feature allows you to control how file version numbers are treated when you copy (PUT) files from local to remote hosts. After connecting to the remote host, you toggle the Store Unique feature on and off by issuing the sunique command at the FTP prompt, as follows: FTP> sunique Store unique on. FTP> sunique Store unique off. FTP> sunique Store unique on. The Store Unique feature behaves differently when copying files between OpenVMS and UNIX. It also behaves differently if you use wildcards or specify version numbers. The following table shows the results when you copy the file text.txt from OpenVMS to UNIX. File test.txt Exists Store on UNIX Unique FTP Command System On Store Unique Off FTP> PUT No text.txt text.txt text.txt FTP> PUT Yes text.txt.1 text.txt text.txt The next table shows the results when you copy the file text.txt;* from OpenVMS to UNIX. Files test.txt.1 test.txt.2 Exist on Store UNIX Unique FTP Command System On Store Unique Off FTP> PUT No text.txt.2 text.txt.2 text.txt;* text.txt.1 text.txt.1 FTP> PUT Yes text.txt.2text.txt.2 text.txt;* text.txt.1 text.txt.1.1
2 – VMS Plus Mode
FTP performs fast file transfers between two OpenVMS systems by using VMS Plus Mode. When FTP identifies file transfers between two OpenVMS hosts running TCP/IP Services, it transfers files in large blocks rather than in small records. VMS Plus Mode greatly increases the transfer speed and preserves all Record Management Services (RMS) file attributes. FTP automatically disables VMS Plus Mode when your session is with a UNIX host or with an OpenVMS host not running TCP/IP Services.
3 – Preserving File Attributes
When you transfer OpenVMS files to a UNIX system and back again, some record attributes might be lost. To preserve all RMS file attributes, use the /FDL qualifier (File Definition Language) with the GET and PUT commands. You might also need to use the SET TYPE command to determine the type of file transfer: o Specifying SET TYPE ASCII results in a sequential file with variable records. Select this type when transferring ASCII text files. o Specifying SET TYPE IMAGE results in a sequential file with fixed records of 512 bytes. Select this type when transferring non-ASCII files, such as binary files or executable image files. For example, to transfer an executable image to a remote UNIX host, follow these steps: 1. Specify the IMAGE data type: FTP> SET TYPE IMAGE 2. Transfer the file to the remote host. At the same time, create and transfer a secondary file with the file's OpenVMS record attributes: FTP> PUT/FDL file To retrieve the file from a remote UNIX host, follow these steps: 1. Specify the IMAGE data type: FTP> SET TYPE IMAGE 2. Retrieve the file from the remote host after retrieving and using the secondary file containing the file's OpenVMS record attributes: FTP> GET/FDL file.dat
4 – Examples
1. In the following example, the PUT/FDL command does the following: o Creates the FDL file cygnet.bckfdl on the remote host with the RMS attributes of file STAT.BCK. o Transfers the data in STAT.BCK and puts it in to cygnet.bckfdl on the remote host. FTP> PUT/FDL STAT.BCK CYGNET.BCK 200 TYPE set to ASCII 200 PORT command successful 150 Opening data connection for cygnet.bckfdl (130.180.4.8,1028) 226 Transfer complete local: cygnet.bckfdl remote: cygnet.bckfdl 846 bytes sent in 00:00:00.03 seconds 200 TYPE set to IMAGE 200 PORT command successful 150 Opening data connection for cygnet.bck (130.180.4.8,1029) 226 Transfer complete local: STAT.BCK remote: cygnet.bck 8152 bytes sent in 00:00:00.12 seconds In the following example, the GET/FDL command performs the following actions: o Transfers the FDL file cygnet.bckfdl from the remote host to the local host. o Uses this file to re-create the file STAT.BCK, with all of its original RMS attributes, on the local host. o Transfers the data in cygnet.bck to the new local file STAT.BCK. FTP> GET/FDL CYGNET.BCK STAT.BCK 200 TYPE set to ASCII 200 PORT command successful 150 Opening data connection for cygnet.bckfdl (130.180.4.8,1028) 226 Transfer complete local: cygnet.bckfdl remote: cygnet.bckfdl 846 bytes sent in 00:00:00.03 seconds 200 TYPE set to IMAGE 200 PORT command successful 150 Opening data connection for cygnet.bck (130.180.4.8,1029) 226 Transfer complete local: STAT.BCK remote: cygnet.bck 8152 bytes sent in 00:00:00.12 seconds
5 – Transfer Mode
TCP/IP Services supports only STREAM mode for data transfer. STREAM mode transmits the data as a stream of bytes.
6 – File Structure
TCP/IP Services supports transfers of ASCII (stream, records with variable length) and IMAGE (binary, records fixed at 512 bytes) files.