smbc_telldir and offsets ...

Richard Sharpe sharpe at ns.aus.com
Tue Mar 27 06:48:11 GMT 2001


Hi,

I have implemented the smbc_telldir function, which is meant to be similar
to the telldir function in UNIX.

You call it and it returns an offset into a directory that you can go back
to with an smbc_lseekdir ...

However, there are some problems that require the semantics to be somewhat
different to the normal UNIX telldir/lseekdir pair.

For example, the directory is some sort of opaque remote object, and the
implementation inside the cli_xxx routines mean that I have to return a
handle to a directory entry that can be found again by the smbc_lseekdir
routine.

You cannot simply pass and offset in and expect the routine to get it right. 

Also, when you are at the beginning of the directory, smbc_telldir does not
return 0, rather it returns a handle that allows us to find that entry again. 

When you are at the end of the directory, you get back 0 (or NULL).

So, does anyone think this is a big problem?


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






More information about the samba-technical mailing list