libsmbclient and browsing: dirents and entry type ...

Richard Sharpe sharpe at ns.aus.com
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_ALL_WORKGROUPS or SMBC_TOP
>>   SMBC_WORKGROUP
>>   SMBC_SERVER
>>   SMBC_SHARE
>>   SMBC_DIR
>>   SMBC_FILE
>>   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 easysw.com
>Printing Software for UNIX                       http://www.easysw.com
>

Regards
-------
Richard Sharpe, sharpe at ns.aus.com
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba






More information about the samba-technical mailing list