Clarify the scp_write examples slightly and use an octal mask for the mode
This commit is contained in:
parent
9162fd7e61
commit
11ca8d5583
@ -142,8 +142,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Request a file via SCP */
|
/* Send a file via scp. The mode parameter must only have permissions! */
|
||||||
channel = libssh2_scp_send(session, scppath, 0x1FF & fileinfo.st_mode,
|
channel = libssh2_scp_send(session, scppath, fileinfo.st_mode & 0777,
|
||||||
(unsigned long)fileinfo.st_size);
|
(unsigned long)fileinfo.st_size);
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
|
@ -153,9 +153,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Request a file via SCP */
|
/* Send a file via scp. The mode parameter must only have permissions! */
|
||||||
do {
|
do {
|
||||||
channel = libssh2_scp_send(session, scppath, 0x1FF & fileinfo.st_mode,
|
channel = libssh2_scp_send(session, scppath, fileinfo.st_mode & 0777,
|
||||||
(unsigned long)fileinfo.st_size);
|
(unsigned long)fileinfo.st_size);
|
||||||
|
|
||||||
if ((!channel) && (libssh2_session_last_errno(session) !=
|
if ((!channel) && (libssh2_session_last_errno(session) !=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user