Libssh2 scp send ex

From Libssh2

LIBSSH2_CHANNEL *libssh2_scp_send_ex(LIBSSH2_SESSION *session,
                                     const char *path,
                                     int mode, size_t size,
                                     long mtime, long atime);
#define libssh2_scp_send(session, path, mode, size) \
        libssh2_scp_send_ex((session), (path), (mode), (size), 0, 0)

About

Send a file to the remote host via SCP. This function acts as a wrapper calling libssh2_channel_open_session(), libssh2_channel_exec(), and negotiating rcp protocol handshakes.

Parameters

  • session
    Session instance as returned by libssh2_session_init().
  • path
    Full path and filename of file to transfer
  • mode
    File access mode to create file with
  • size
    Size of file being transmitted (Must be known ahead of time precisely)
  • mtime
    mtime to assign to file being created
  • atime
    atime to assign to file being created (Set this and mtime to zero toinstruct remote host to use current time).

Returns

  • On Success
    Newly allocated Channel instance.
  • On Failure
    NULL