Discussion:
Question about function parameter of libssh2_sftp_readdir_ex
Samuel Zhao
2018-02-01 03:57:11 UTC
Permalink
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
Will Cosgrove
2018-02-01 18:50:47 UTC
Permalink
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 <***@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>
Samuel Zhao
2018-09-26 02:01:28 UTC
Permalink
Hello All,

any function in libssh2 to do mv file from src to dest or any workarroud solution? eg. mv src/filename dest/filename

thanks a lot.



Samuel Zhao
Loading...