ftpputunique()

The ftpputunique() call transfers a file to a host and ensures it is created with a unique name.

Syntax

#include <ftpapi.h>

int ftpputunique(host, userid, passwd, acct, local, remote,
                 transfertype)
char *host;
char *userid;
char *passwd;
char *acct;
char *local;
char *remote;
int transfertype;

Parameters

host

userid passwd acct local remote transfertype

Description

The ftpputunique() call copies a local file to a file on a specified host. It guarantees that the new file will have a unique name and that the new file will not overwrite a file with the same name. If the file already exists on the host, a new and unique file name is created and used as the target of the file transfer.

Return Values

The value 0 indicates success; the value -1 indicates an error. The value of ftperrno indicates the specific error. See Return Values for a description of the return codes.

Examples

int rc;rc=ftpputunique(
       "conypc","jason","ehgr1",NULL,"abc.doc", "new.doc",T_ASCII);

The ASCII file abc.doc is copied to the current working directory of the host conypc as file new.doc, unless the file new.doc already exists. If the file new.doc already exists, the file new.doc is given a new name unique within the current working directory on the host conypc. The name of the new file is displayed upon successful completion of the file transfer.


[Back: ftpput()]
[Next: ftppwd()]