ssh2-streams icon indicating copy to clipboard operation
ssh2-streams copied to clipboard

readdir(handle, callback) doesn't seem to give list==false at end of listing

Open watery opened this issue 7 years ago • 3 comments

As per the documentation, readdir callback should receive a boolean false as the list argument when the folder listing is over, but I don't see it and my code breaks with EOF.

~~I've tried giving a look at sftp.js and it seems to me that on EOF the cb receives and empty array~~ (see my other comment).

I'm using version 0.1.20, got with ssh2 0.5.5

watery avatar Feb 07 '18 08:02 watery

What are you passing as the first argument to readdir()? A path string or a directory handle?

mscdex avatar Feb 07 '18 08:02 mscdex

A directory handle obtained, with opendir.

watery avatar Feb 07 '18 08:02 watery

Ugh, forget my comment on sftp.js, after a closer look I was looking at code inside a

if (typeof where === 'string') {

watery avatar Feb 07 '18 08:02 watery