Subject: libssh2_channel_read() issue

libssh2_channel_read() issue

From: Amirul Islam <>
Date: Wed, 17 Feb 2016 14:53:34 +0430

Hi All,

I am having an issue with the libssh2_channel_read() function. I am using
it in blocking mode to download files from remote server. Now, I have an
instance where the file I am trying to download, I do not have read
permission. This is causing the read() function to return 0. I am not sure,
if I should break my read loop when 0 is returned, since the documentation
implies we should break when there is a negative value returned. I am not
if breaking on 0 will have unpredictable behavior on other instances. need

Also, I can check the file mode when I call libssh2_scp_recv() function,
what would be the best way to check if my user has read permission?

Thank you in advance.

"Fame is a vapor; popularity an accident; the only earthly certainty is

Received on 2016-02-17