Subject: Re: Question about function parameter of libssh2_sftp_readdir_ex

Re: Question about function parameter of libssh2_sftp_readdir_ex

From: Will Cosgrove <will_at_panic.com>
Date: Thu, 1 Feb 2018 10:50:47 -0800

Hi Samuel,
Longentry is the entire unix style entry for the item, such as:

"-rw------- 1 test test 636 Jan 3 12:20 file.txt"

Buffer is simply the file name. Use the one that will work for your use-case.

Will

> On Jan 31, 2018, at 7:57 PM, Samuel Zhao <samuelzhao_at_126.com> wrote:
>
> Hi all,
> Here is the function:
> int libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle,
> char *buffer, size_t buffer_maxlen,
> char *longentry, size_t longentry_maxlen,
> LIBSSH2_SFTP_ATTRIBUTES *attrs);
> From man page description, buffer and longentry seem to both recv the file name from ftp server. What's the difference between them?
> If I want to get a file list by 'ls' command in ftp client, which one should I read file name from?
>
> Thanks for any help.
>
> Samuel Zhao
> _______________________________________________
> libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel <https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>

_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2018-02-01