libsmbclient and browsing: dirents and entry type ...

Richard Sharpe sharpe at
Mon Jan 1 14:13:28 GMT 2001

At 09:55 AM 1/1/01 -0500, Michael Sweet wrote:
>Richard Sharpe wrote:
>> ...
>> The normal paradigm that I expect to be used is:
>>    dirp = smbc_opendir("smb://");
>>    while (dir = readdir(dirp)) {
>> ...
>I strongly recommend *against* shoe-horning the SAMBA browsing stuff
>into the "standard" directory functions - no two UNIX's use the
>same dirent structure (in fact, some use a structure named "direct")
>If instead you provide your own smbc_dirent structure, it can
>contain the smbc_stat values.

OK, but my concern with taking this approach is that it will require a
different style of programming for dealing with directories with
libsmbclient than with UNIX-style directories ...

Do the advantages outweigh the problems?

>> from among:
>>   SMBC_LINK???
>I think you'll want to identify the type of share - directory or
>printer or whatever.  Other than that, it looks like enough
>information to implement all sorts of applications.
>Michael Sweet, Easy Software Products                  mike at
>Printing Software for UNIX             

Richard Sharpe, sharpe at
Samba (Team member,, Ethereal (Team member,
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba

More information about the samba-technical mailing list