HPlogo Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00): HP 3000 MPE/iX Computer Systems > Chapter 10 Technical Articles

FTP Enhancements

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

by Raghuram B. Commercial Systems Division

The following is a description of new features available with FTP/iX.

Implementation of FTPSRVR under INETD

Prior to Release 6.0, the FTP/iX server, FTPSRVR, was initiated by the FTPMON process by the JFTPSTRT.ARPA.SYS job. For 6.0, the JFTPSTRT.ARPA.SYS job is no longer used.

Instead the job, JINETD.NET.SYS is streamed to initiate the FTP server. To properly configure a system for FTP, please read the "Starting FTP" chapter of the Installing and Managing HP ARPA File Transfer Protocol Network Manager's Guide.

Anonymous FTP Functionality

FTP/iX anonymous logon allows a restricted access to the MPE/iX file system via the FTP/iX server, without the need for a logon account. The remote user can access the FTP/iX anonymous environment by specifying either one of the accepted user names 'anonymous' or 'ftp' (these login id's are currently defacto standards).

The system administrator can decide whether or not to have anonymous FTP for his MPE FTP server.

The anonymous ftp user can access files that are rooted at /FTPGUEST/PUB. While any attempt to traverse the MPE/iX directory structures beyond /FTPGUEST/PUB is denied, the FTP user can access, create, or delete files and directories below the defined root. This ensures that the security of the HP3000 system is intact.

Except for "site stream" command all the other FTP/iX commands will be executed, but under anonymous restrictions based at the defined absolute root path of /FTPGUEST/PUB.

Here is a sample Anonymous login:

ftp> open pilot5 Connected to pilot5 220 HP ARPA FTP Server [A00080ZZ] (C) Hewlett-Packard Co. 1990  Name (pilot5:manager): anonymous 331-Guest login ok, send ident as password.  Password: 230 User logged on Remote system type is MPE/iX. ftp>pwd 257-"/" is the current directory. 257 "Anonymous FTP" is the current session.  ftp>

Support for Non-Standard MPE/iX File Types

The following types of MPE/iX files can be transferred to a remote host using FTP.

  • Standard MPE files with fixed, variable or bytestream format.

  • Files with either binary or ASCII data types.

In addition, the latest enhancements enable the transfer of the following types of non-standard files between two HP3000 machines.

  • Privileged files (files with PRIV file code)

  • Circular files

  • Message files

  • RIO files

  • CM KSAM files

  • NM KSAM files

  • HPSPOOL files

The type of the file is transparent to the user. The user need not specify the file type being transferring.

Of these, SPOOL files are transferred as fixed ascii files. The above non-standard file transfers are not possible between an MPE and an non-MPE system. However, SPOOL files can be transferred as fixed ascii files from an MPE to a non-MPE system.

The client (FTP) and server (FTPSRVR) must be compatible to take advantage of this feature. The above file types can be transferred between like FTP/iX systems without the need for buildparms on the command line. Buildparms included on the command line are ignored if the file is a non-standard file type. The use of buildparms is accepted only for standard file types (file code of zero).

Non-standard file type transfers to incompatible FTP/iX versions result in a data transfer failure message. You cannot append to non-standard MPE/iX file types with the use of this new feature. Non-standard file transfers to non-MPE/iX systems also result in a data transfer failure. Non-compatibility of client and server file transfer requests result in appropriate error messages.

Example

FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MX
DB000     PRIV    128W  FB           6          6   1       16  1  1
ftp> get db000
200 PORT command okay
150 File: db000 opened; data connection will be opened
2816 bytes received in 0.02 seconds (130.95 Kbytes/sec)
ftp>
FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MXBIGRIO1           128B  FAR       8193       8192   3     4128  1  8
ftp> get bigrio1 
200 PORT command okay
150 File: bigrio1 opened; data connection will be opened
1054934 bytes received in 3.69 seconds (279.27 Kbytes/sec)
ftp>

The Configurable Server Time-Out

Current patch releases of FTP/iX 5.0 and 5.5 have a hard-coded infinite time-out value applied to the data connection timer of the FTP/iX server. The FTP/iX client, which shares this data connection, has a configurable time-out which is user-controlled through the TIMEOUT command.

The latest enhancements provide a configurable server time-out. This allows the client side to control the time-out value that the server applies to its data connection timer. To set the time-out value, execute the SITE TIMEOUT command with a value from 0 (infinite) to 3000 seconds.

Syntax

SITE TIMEOUT [num-secs]

The time-out value indicates how long the FTP server should wait for a message from the remote FTP client before giving up. The allowable range is 0 to 3000. A value from 1 to 3000 indicates a time-out value in seconds. A value of 0 means no time-out (that is, wait forever). If num-secs is not specified, the current remote time-out value is displayed. Otherwise, this command sets the connection time-out to num-secs seconds.

Example

Command for the server to time out after 5 minutes (300 seconds).

ftp>site timeout 300
200 TIMEOUT command ok.
ftp>

Hash Command

While transferring files, if the user desires to receive progress status during file transmission, the hash command provides this capability. This is a user command at the client end, which allows the user to toggle state of the hash command. If the toggle state is 'on' a hash symbol (#) is displayed every 1024 characters transferred. The default is set to 'off'.

Example

ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> get TESTFILE
200 PORT command successful.
150 Opening BINARY mode data connection for TESTFILE (145915 bytes) ###############################################################
###############################################################
########
226 Transfer complete
145915 bytes received in 0.32 seconds (438.45 Kbytes/sec)

REPLACE Option

This FTP/iX client controlled option allows the user to override the default file placement strategy of FTP/iX (unconditional replacement of the target file).

Executing the client REPLACE command will toggle the current state (on or off). If the REPLACE option state, displayed by the REPLACE command is on, FTP/iX will unconditionally replace the specified target file. If the transfer state is set to off and a target file with the specified name exists on the target system, the FTP/iX client will prompt the user with a question (asking if it is okay to continue with the requested transfer). Otherwise, if the target file doesn't exist, FTP/iX will create the target file and continue with the transfer.

The user also has control over the REPLACE option by externally setting the environment variable FTPREPLACE to the desired state prior to entering the FTP/iX subsystem TRUE - on; FALSE - off). The default state for this option is TRUE (on).

Example

Using the REPLACE Option with the GET Command:

ftp>get abc def
200 PORT command ok.
150 File: DEF;REC=-80,1,F,ASCII;DISC=204800,8 opened; data connection will be opened
226 Transfer complete.
ftp>REPLACE
REPLACE option set to off (FTPINFO 99).
ftp>get abc def
File def exists! Do you want to replace it?>y
200 PORT command ok.
150 File: DEF;REC=-80,1,F,ASCII;DISC=204800,8 opened; data connect opened
ftp>get abc def
File def exists! Do you want to replace it?>n
New target file name: wxy
150 File: WXY;REC=-80,1,F,ASCII;DISC=204800,8 opened; data connect opened
226 Transfer complete.

MOVE Option

This FTP/iX user controlled option allows the user to selectively specify on the GET, PUT, MGET, or MPUT commands whether to delete the source file after confirmation of a successful file transfer to the target system. MPE/iX file security and access rights may prevent successful removal of the original source file despite the use of the MOVE command.

Syntax

          { get }          { put }          {     } source file [target file][;buildparms] [;move]           { mget}          { mput}           Parameters :  none           Operation : This option requests that the specified source
file be physically moved from the source location to the specified target location.

Example

Example Use of The MOVE Option with the MGET Command

ftp>ls *
200 PORT command ok.
150 File: LISTFILE @,6 opened; data connection will be opened
abc
def
ghi
klm
226 Transfer complete.
20 bytes received in 0.08 seconds (0.26 Kbytes/sec)
ftp>mget *;move
200 PORT command ok.
150 File: LISTFILE @,6 opened; data connection will be opened
226 Transfer complete.
20 bytes received in 0.06 seconds (0.31 Kbytes/sec)
mget abc? y
200 PORT command ok.
150 File: ABC opened; data connection will be opened
226 Transfer complete.
100 bytes received in 0.03 seconds (3.49 Kbytes/sec)
mget def? y
200 PORT command ok.
150 File: DEF opened; data connection will be opened
226 Transfer complete.
100 bytes received in 0.03 seconds (3.05 Kbytes/sec)
mget ghi? y
200 PORT command ok.
150 File: GHI opened; data connection will be opened
226 Transfer complete.
100 bytes received in 0.04 seconds (2.57 Kbytes/sec)
mget klm? y
200 PORT command ok.
150 File: KLM opened; data connection will be opened
226 Transfer complete.
100 bytes received in 0.03 seconds (3.37 Kbytes/sec)
ftp>ls *
200 PORT command ok.
150 File: LISTFILE @,6 opened; data connection will be opened
226 Transfer complete.

The Implementation of CI Environment Variables for Additional FTP/iX Status Information

The following status information will be provided through these CI environment variables:

FTPXFERFILES

number of files successfully transferred during the last FTP/iX execution.

FTPREQFILES

total number of files requested for transfer during the last FTP/iX execution.

FTPREPLACE

reflects the state of the file placement policy of FTP/iX: either unconditionally (TRUE) or conditionally (FALSE) replace the target file(s) specified in the user commands GET, PUT, MPUT, and MGET (see the REPLACE option for additional details).

The following environment variables are currently supplied with FTP/iX:

FTPLASTERR

identifies the last FTP error encountered.

FTPLASTREPLY

identifies the last FTP protocol reply message string.

The addition of the aforementioned environment variables will provide the interactive and batch FTP/iX environments with additional status information for control of processes outside the FTP/iX subsystem.

Example Use of Environment Variables

:showvar FTP@
FTPLASTERR = 0
FTPLASTREPLY = 221 Server is closing command connection
FTPXFERFILES = 0
FTPREQFILES = 0
FTPREPLACE = TRUE
.
.
.
ftp>mget *
200 PORT command ok.
150 File: LISTFILE @,6 opened; data connection will be opened
226 Transfer complete.
20 bytes received in 0.07 seconds (0.29 Kbytes/sec)
mget abc? y
200 PORT command ok.
150 File: ABC opened; data connection will be opened
226 Transfer complete.
100 bytes received in 0.03 seconds (3.49 Kbytes/sec)
mget def? y
200 PORT command ok.
150 File: DEF opened; data connection will be opened
226 Transfer complete.
100 bytes received in 0.04 seconds (2.57 Kbytes/sec)
mget ghi? n
mget klm? n
ftp>quit
:
:showvar FTP@
FTPLASTERR = 0
FTPLASTREPLY = 221 Server is closing command connection
FTPXFERFILES = 2
FTPREQFILES = 4
FTPREPLACE = TRUE
:if FTPREQFILES <> 4 and FTPXFERFILES = 2 then
Feedback to webmaster