libsmbclient.h API to get all attributes of all files in folder

Andreas Schneider asn at
Tue Feb 14 12:30:53 UTC 2017

On Tuesday, 14 February 2017 16:37:38 CET Puran Chand wrote:
> Hi Folks,


> I was exploring *libsmbclient.h* for a 'ls' kind of functionality which
> returns all file/folder list in a samba server folder with all attributes.
> (ex name, size, create_time, modified_time, accessed_time, type of file etc)
> The structure in libsmbclient.h (*struct* *smbc_dirent*) doesn't serve the
> purpose as it has the name of file/folder and no details about the nested
> files and all attributes.
> I used the *smbc_getFunctionGetxattr(_context)(_context, samba_url,
> "system.dos.attr*", in_buff, size)* but it returns the attributes of single
> folder and I had to call it again and again for all nested file which has
> performance issues because of authentication overhead.
> I used *smbc_opendir()* API and I can see all the details received by
> client in wireshark packet capture but it returns *SMBCFILE **  which also
> has smbc_dirent and no other attributes.
> Is there any API which solves this for me or am I doing something wrong
> here.
> If No, can I work on writing a public API in *libsmbclient.h* which will
> serve the above mentioned purpose?

libsmbclient provides a POSIX like API.


while dp = readdir(dir) != NULL

Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at

More information about the samba-technical mailing list