Subject: RE: SFTP issues

RE: SFTP issues

From: Mark Smith <>
Date: Thu, 9 Feb 2012 15:00:14 -0000

Daniel Stenberg wrote:

> Or do we already say 0 means EOF?

The documentation on the website states that libssh2_sftp_read() is modelled
on the POSIX read(2) function, which has always returned 0 to indicate EOF.

My own code has always assumed this to be the case, which is why when I
suddenly started getting zero returns when not EOF I was puzzled and assumed
it to be a bug. If we had some other way to determine EOF for SFTP then I
might accept that returning zero might not always mean EOF but there's no
obvious function for determining EOF using any other means than returning
zero out of libssh2_sftp_read() - I'm assuming that libssh2_channel_eof()
cannot be used in this case.

If this is as active a discussion as it seems, perhaps it could be more
effectively explored using IRC?

Received on 2012-02-09