FTP Enhancements [ COMMUNICATOR 3000 MPE MPE/iX RELEASE 4.5 ] MPE/iX Communicators
COMMUNICATOR 3000 MPE MPE/iX RELEASE 4.5
FTP Enhancements
by John T. Beck
Information Networks Division
NEW COMMANDS
This version of FTP includes eight new FTP/iX client commands and six
server commands. All are listed below. Note that the client cd command,
which was supported prior to this release of MPE/iX, is included for the
sake of completeness.
Client Server
------ ------
site SITE
mkdir MKD
cd CWD
rmdir RMD
size SIZE
modtime MDTM
lcd
timeout
reset
With the addition of these commands, FTP now supports both the MPE-space
and the POSIX-space of the MPE/iX file system, as the following
describes.
THE MPE/iX FILE SYSTEM
The new MPE/iX file system partitions all files into either MPE files or
POSIX files. MPE files remain the same: all uppercase, with an eight
character limit. POSIX files can have longer names, mixed case, and so
on.
How does the file system know whether a user is referring to an MPE file
or a POSIX file? The differentiator used is the first character of the
given name. If a file name starts with a dot "." or a slash "/", then it
is a POSIX file; otherwise, it is an MPE file. For example, filename
refers to FILENAME.LOCALGRP.LOCALACT, whereas ./filename refers to
/<PWD>/filename, where LOCALGRP and LOCALACT are the local group and
account as before, and <PWD> refers to the current working directory in
the POSIX space.
How does the current working directory get set? When a user logs on as
USER.ACCT,GROUP, the current working directory is initialized to
/ACCT/GROUP. If a user creates a directory dir1 within that group and
changes to it, the new working directory is /ACCT/GROUP/dir1.
Note that "." refers to the current working directory, ".." refers to the
directory above the current working directory, and "/" is used as the
separator in the path name. Thus, if a file name starts with "." or
"..", the path traversed to find the file is relative to the current
working directory, whereas if a file name starts with "/", the path is
taken from the file system root directory.
LISTING FILES
The MPE LISTF command will not report POSIX files; the LISTFILE command
must be used instead. The FTP server LIST and NLST commands have
therefore switched to use LISTFILE now. The LIST command maps to
LISTFILE <file-set>,2 and the NLST commands maps to LISTFILE
<file-set>,6. As mentioned above, a file set specification must start
with a dot or a slash to include POSIX file names. For example, @ refers
to all MPE-space files, whereas ./@ refers to all files, both MPE-space
and POSIX-space. If no file set is specified, the default is ./@.
HIERARCHICAL DIRECTORIES
You can use the FTP mkdir command to create new directories in the
POSIX-space. Note that the FTP/iX server prepends ./ to your given name
if it does not start with either a dot or a slash. This is done to make
FTP easier to use.
You can then change to this directory by issuing the cd command. Again,
./ is prepended to the name you give if your name does not start with a
dot or a slash. You can specify either a relative path or an absolute
one.
Once you have changed directories, you may wish to verify where you are.
Use the pwd command for this purpose. It displays both the current
working directory as well as the current session information.
In addition to changing directories on the remote system, you can do the
same on the local system by using the lcd command. This command also
prepends ./ to the given name if it does not start with a dot or a slash.
Note that the lcd command automatically tells you the new current working
directory.
You can remove directories with the rmdir command. Again, ./ is
prepended to the given file name if it does not start with a dot or a
slash. Note that rmdir will not work on MPE groups or accounts.
Similarly, mkdir creates new directories, not groups or accounts.
BYTE-STREAM FILES
There now is a new record format supported by the MPE/iX file system, in
addition to the old fixed, variable and undefined length records. This
new type is called byte stream. The purpose of this new record format is
to more closely emulate files on character-oriented file systems.
To create such a file, use the build parameters:
ftp> put <source-file> <target-file>;rec=,,b
The "b" stands for byte stream. Note that no record size is given. This
is because byte stream files always have one byte records; any other
value would be overwritten. Similarly byte stream files are always
ASCII.
TRANSFERRING FILES
Nothing has changed as far as the actual file transfer is concerned. The
get, put, mget and mput commands all behave as before. Note, though,
that file names are taken verbatim, as opposed to the directory commands
described above, which prepend ./ in some instances. The reason for the
difference is that directory commands are always dealing with POSIX
files, so prepending a ./ was deemed helpful to the user, whereas both
MPE files and POSIX files can be transferred, so it would not always be
appropriate to modify the given file name.
OTHER NEW COMMANDS
The site command sends site-specific commands to a remote server. The
only site-specific commands currently supported by the FTP/iX server are
HELP and MPE/iX. The first returns which site-specific commands are
supported; the other tells the server that the client is an MPE/iX
machine. This parameter list may be extended in the future.
The site command is most useful for inter-operating with remote servers
on non-HP platforms. Such a server may support site-specific commands
appropriate for its own proprietary purposes. For example, one customer
who wanted to stream a JES job on an IBM host used the following command
sequence:
ftp> site filetype=jes
ftp> put filename.jes
ftp> site filetype=seq
The size command takes a file name as a parameter. It returns the size
of the file in bytes.
The modtime command also takes a file name as a parameter. It returns
the last time and date that the file was modified.
The timeout command deals with the connection time-out value, which
indicates how long to wait for a message from the remote FTP server
before giving up. This commands takes an optional parameter as the
number of seconds to wait. If no parameter is specified, the current
time-out value is displayed.
The reset command re-synchronizes command/reply sequencing with the
remote FTP server. Resynchronization may be necessary following a
violation of the FTP protocol by the remote server.
MPE/iX Communicators