Subject: Re: Getting filetype

Re: Getting filetype

From: double <>
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:

    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

Received on 2010-04-07