Subject: Re: Getting filetype

Re: Getting filetype

From: double <ninive_at_gmx.at>
Date: Wed, 07 Apr 2010 23:29:12 +0200

Hi Heiner,

Heiner Steven schrieb:
> Have a look at the libssh2_sftp_fstat_ex(3) manual page. the attributes
> are similar to what you'd expect in struct stat, stat(2) system call.

Thanks a lot for your answer.

"libssh2_sftp_fstat_ex()" returns this structure, but none of them contains
the filetype:

struct _LIBSSH2_SFTP_ATTRIBUTES {
    unsigned long flags; /* which of the down below elements
are valid... */
    libssh2_uint64_t filesize;
    unsigned long uid, gid;
    unsigned long permissions;
    unsigned long atime, mtime;
};

In "stat()" you will have a element "st_mode", so you could
check: S_ISDIR(buffer.st_mode)

Thanks a lot
Marcus

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-04-07