libsmbclient/smbc_opendir problem with large directories.

Henrik Zagerholm henke at
Mon Jun 12 11:55:53 GMT 2006

Hi Samba team,

I'm currently coding some C++ wrapper functions around libsmbclient.c.

I experience really weird results when dealing with directories with  
many dir entries ( With my setup/hardware around 2000+ )

smbc_opendir returns a valid smbc_file but the dir entries are not  
complete (their names are truncated to one character)

It seems to be a timeout problem because when I run my testprogram  
against the same client the problem disappears as the files get  
cached on the client.
After flushing the file cache on the client the problem returns.

Is there a more controllable way of getting dir entries?
Are there more timeout variables other than context->timeout that I  
can manipulate?

Setting context->timeout to high values seems to solve the problem  
but is there a better way to handle this?
(E.g reading only a part of the entries at a time)

Increasing the timeout really isn't a viable solution as I can never  
be sure how many dir entries a client has or the performance of its  


More information about the samba-technical mailing list