NonStop SSH SFTP API Reference Manual
Migrating FTP API Applications to
SFTP API
Overview
The SFTP API has been designed to make migrating FTP API applications as easy as possible. Migration of an existing
application will typically involve the following tasks:
1. Making your application invoke SFTP instead of FTP
2. Analyzing your application according to the aspects described under "Migration Considerations" below
3. Implementing any required application changes or SSH configuration uncovered by the analysis
4. Testing the application with SFTP
Making your application invoke SFTP
There are two options how you can make your application use SFTP instead of FTP.
1. Setting the FTPPGM variable to refer to the SFTP program file.
By default it points to the FTP object. In $SYSTEM.ZTCPIP.FTPEXTH:
/* variable pointing to which ftp program to use */
char *FTPPGM = "$SYSTEM.SYSTEM.FTP";
and must be set to have it point to an SFTP object.
It is possible to modify it between opens allowing to establish both FTP and SFTP sessions.
The SFTP program resides in $SYSTEM.SYSnn and should be copied from there to the custom location for
programmatic use.
> VOLUME $MYVOL.MYFTP
> FUP DUP $SYSTEM.SYS00.SFTP, *, SAVEALL
In your application code, add a line of code (or alter any existing) as follows:
FTPPGM = "$MYVOL.MYFTP.SFTP"; /* $MYVOL.MYFTP is the dedicated subvolume where
SFTP has been copied */
Remember that the license file for the SFTP API must then also reside within the custom location.
Changing your application code requires recompilation to make the changes effective.
Newer NonStop SSH releases copy the SFTP object to subvolume $SYSTEM.ZSFTPAPI during installation.
This subvolume can be used as custom location for the SFTP object and no further copy is needed.
HP NonStop SFTP API Reference Manual . Migrating FTP API Applications to SFTP API • 9