Subject: Re: Distinguishing directories versus files

Re: Distinguishing directories versus files

From: Michael Loutris <>
Date: Thu, 22 Oct 2020 18:17:59 -0500 (CDT)

Hello Gebi,

Thank you for replying and that's a great answer! Dan Fandrich got back to me earlier with the same information and I'll put it to use.
However, I did open a ticket for an enhancement. My understanding is that after the SFTP directory listing retrieval, we must issue separate SFTP checks for each file, which could probably be improved.
I opened an issue to see if a new flag could be used to send back the file name bundled with the files other attributes.

Best Regards,

Mike Loutris

> On 10/22/2020 5:43 PM Gebi Miguel <> wrote:
> I remember asking myself the same question a few months ago and ended up using the macro LIBSSH2_SFTP_S_ISDIR ().
> On October 22, 2020 1:43:33 PM PDT, Michael Loutris <> wrote:
> > > I was successful in retrieving the contents of a server's directory, but when I looked at the attributes, I didn't see anyway to identify a directory versus normal files. I am working on SFTP communication between to Windows devices.
> > Is there a way to tell an ordinary file from other file types when requesting the directory contents via SFTP with libssh2?
> >
> > Thank you
> >
> > > _______________________________________________
> libssh2-devel

Received on 2020-10-23