SUNIQUE (Control Overwriting of Files)

The SUNIQUE IBM® i FTP client subcommand controls file replacement. SUNIQUE is a separate command that has to be issued before the PUT or MPUT subcommands.

FTP server subcommand

SUNIQUE sets a "mode" (in the same manner as NAMEFMT, LISTFMT, and so on.), so that every PUT/MPUT after it uses the setting entered on the SUNIQUE subcommand. For example:
FTP> SUNIQUE 1
FTP> MPUT *.FILES

If there is no parameter, SUNIQUE acts like a toggle switch. The SUNIQUE value changes from 0 (OFF) to 1 (ON) or from 1 to 0.

When there is a parameter, the valid values are:

0
Overwrite the file if it exists. This is the default.
1
Create a new file with a unique name on the remote system instead of overwriting an existing file. The FTP server on the remote system sends the name of the created file back to the user.
Note: If the remote system is a IBM i product, the FTP server forms File.Mbr names by adding numbers to the end of the localfile that you specified in the PUT or MPUT subcommand. Thus, if the name NEWFILE.NEWMBR already exists on the remote system, the FTP server creates NEWFILE.NEWMBR1 and writes the data to it.

File names for other file systems, like hierarchical file system (HFS), work in a similar way. If the name already exists, a new file is created that consists of the specified file name and a number suffix. Thus, if the name xfsname already exists on the remote system, the remote system creates xfsname1.