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

Puran Chand puran157 at gmail.com
Wed Feb 15 04:45:33 UTC 2017


This worked but performance wise its poor.
For large number of files in directory, this is taking huge time.
It seems for every smbc_stat() call, its opening a fresh connection and
closing it after fetching attributes. The authentication is an overhead for
this approach.

On Tue, Feb 14, 2017 at 6:00 PM, Andreas Schneider <asn at samba.org> wrote:

> On Tuesday, 14 February 2017 16:37:38 CET Puran Chand wrote:
> > Hi Folks,
>
> Hi,
>
> > 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.
>
> opendir(dir)
>
> while dp = readdir(dir) != NULL
>         stat(dp->name)
>
>
>
> --
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             asn at samba.org
> www.samba.org
>



-- 

*RegardsPuran Chand*
*Member of Technical Staff,*
*VMware Bangalore,*

*Bangalore-560037+917829894724*


More information about the samba-technical mailing list