1libssh2_sftp_rename_ex(3)           libssh2          libssh2_sftp_rename_ex(3)
2
3
4

NAME

6       libssh2_sftp_rename_ex - rename an SFTP file
7

SYNOPSIS

9       #include <libssh2.h>
10       #include <libssh2_sftp.h>
11
12       int
13       libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp,
14                              const char *source_filename,
15                              unsigned int source_filename_len,
16                              const char *dest_filename,
17                              unsigned int dest_filename_len,
18                              long flags);
19
20       int
21       libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp,
22                              const char *source_filename,
23                              const char *dest_filename);
24

DESCRIPTION

26       sftp - SFTP instance as returned by libssh2_sftp_init(3)
27
28       sourcefile - Path and name of the existing filesystem entry
29
30       sourcefile_len - Length of the path and name of the existing filesystem
31       entry
32
33       destfile - Path and name of the target filesystem entry
34
35       destfile_len - Length of the path and name of the target filesystem en‐
36       try
37
38       flags - Bitmask flags made up of LIBSSH2_SFTP_RENAME_* constants.
39
40       Rename  a  filesystem object on the remote filesystem. The semantics of
41       this command typically include the ability to move a filesystem  object
42       between  folders  and/or  filesystem  mounts.  If  the LIBSSH2_SFTP_RE‐
43       NAME_OVERWRITE flag is not set and the destfile entry  already  exists,
44       the  operation will fail. Use of the other two flags indicate a prefer‐
45       ence (but not a requirement) for the remote end to  perform  an  atomic
46       rename operation and/or using native system calls when possible.
47

RETURN VALUE

49       Return  0  on  success  or negative on failure.  It returns LIBSSH2_ER‐
50       ROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is
51       a negative number, it is not really a failure per se.
52

ERRORS

54       LIBSSH2_ERROR_ALLOC -  An internal memory allocation call failed.
55
56       LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
57
58       LIBSSH2_ERROR_SOCKET_TIMEOUT -
59
60       LIBSSH2_ERROR_SFTP_PROTOCOL - An invalid SFTP protocol response was re‐
61       ceived on the socket, or an SFTP operation caused an  errorcode  to  be
62       returned by the server.
63

SEE ALSO

65       libssh2_sftp_init(3)
66
67
68
69libssh2 0.15                      1 Jun 2007         libssh2_sftp_rename_ex(3)
Impressum