Libssh2 sftp symlink ex

From Libssh2

int libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp, const char *path, int path_len,
                            char *target, int target_len, int link_type);

#define libssh2_sftp_symlink(sftp, orig, linkpath) \
        libssh2_sftp_symlink_ex((sftp), (orig), strlen(orig), \
                                              (linkpath), strlen(linkpath), LIBSSH2_SFTP_SYMLINK)

#define libssh2_sftp_readlink(sftp, path, target, maxlen) \
        libssh2_sftp_symlink_ex((sftp), (path), strlen(path), \
                                              (target), (maxlen), LIBSSH2_SFTP_READLINK)

#define libssh2_sftp_realpath(sftp, path, target, maxlen) \
        libssh2_sftp_symlink_ex((sftp), (path), strlen(path), \
                                              (target), (maxlen), LIBSSH2_SFTP_REALPATH)

About

  • libssh2_sftp_symlink(): Create a symbolic link between two filesystem objects.
  • libssh2_sftp_readlink(): Resolve a symbolic link filesystem object to its next target.
  • libssh2_sftp_realpath(): Resolve a complex, relative, or symlinked filepath to its effective target.

Parameters

  • sftp
    SFTP instance as returned by libssh2_sftp_init().
  • path / path_len
    Remote filesystem object to create a symlink from or resolve.
  • target / target_len
  • link_type
    One of the three previously mentioned constants which determines the resulting behavior of this function.

Returns

  • On Success: 0
  • On Failure: -1