NonStop SSH SFTP API Reference Manual
2. Replace the FTP program file that your code refers to with the SFTP program.
This option is recommended only if your application code already refers to an FTP program file at a custom
location. In this case you may replace the FTP program with the SFTP program. The commands would be
somewhat as follows:
> VOLUME $MYVOL.MYFTP
> RENAME FTP, FTPOLD
> FUP DUP $SYSTEM.SYS00.SFTP, FTP, SAVEALL
This approach does not require recompiling your application, provided that no other code changes are needed.
Remember that the SFTP API license file must be placed in the custom location as well.
Migration considerations
As the SFTP protocol has significant differences from FTP, there are some important issues that you need to consider
when converting an FTP API application to SFTP.
Unsupported library routines
The following FTP API routines are not supported by SFTP API:
FTP API routine Comment
FTPqoute[_nw] SFTP has no equivalent functionality
FTPproxy[_nw]
SFTP does not support proxy connections. Consequently, all FTP API routines only function on the
PRIMARY connection.
FTPsetfilecode[_nw]
SFTP does not support this function. You may specify the file codes of target files as file name
attributes.
FTPsetstruct[_nw]
SFTP has no equivalent functionality. However, SFTP implicitly supports transfers of structured
files.
FTPsystem SFTP has no equivalent functionality
If your application invokes one of the above routines with SFTP, error 400 (INVALID COMMAND) will be returned.
Establishing Connections
Since SFTP connects to a remote SSH daemon rather than to an FTP server, the following issues need to be considered
with the FTPopen[_nw] routine.
Selecting an SSH2 process to be used by the SFTP client
The SFTP client establishes SSH sessions over an SSH2 process. By default, the SFTP client will try to open one of the
SSH2 process instances named $SSH<nn>, where <nn> is a number between 00 and 15 (usually the CPU number where
the process is executing). If your SSH2 process configuration does not match the default naming schema, then you must
set the DEFINE =SSH2^PROCESS^NAME in your application environment before calling FTPopen[_nw], to specify
the process name of the SSH2 instance to be used by SFTP. You can set the DEFINE programmatically, or you can set it
in your application's startup configuration.
Port number of the remote server
If FTPopen[_nw] is called with -1 as port number (i.e. let system select the port number), the SFTP API will
automatically select the standard SSH port number as default (22).
HP NonStop SFTP API Reference Manual . Migrating FTP API Applications to SFTP API • 10