Logo Search packages:      
Sourcecode: samba-doc-ja version File versions

off_t smbc_telldir ( int  dh  ) 

Get the current directory offset.

smbc_telldir() may be used in conjunction with smbc_readdir() and smbc_lseekdir().

Parameters:
dh Valid directory as returned by smbc_opendir()
Returns:
The current location in the directory stream or -1 if an error occur. The current location is not an offset. Becuase of the implementation, it is a handle that allows the library to find the entry later.
  • EBADF dh is not a valid directory handle
  • EINVAL smbc_init() failed or has not been called
  • ENOTDIR if dh is not a directory
See also:
smbc_readdir()

Definition at line 2241 of file libsmbclient.c.

{
      struct smbc_file *fe;

      if (!smbc_initialized) {

            errno = EINVAL;
            return -1;

      }

      if (fd < smbc_start_fd || fd >= (smbc_start_fd + SMBC_MAX_FD)) {

            errno = EBADF;
            return -1;

      }

      fe = smbc_file_table[fd - smbc_start_fd];

      if (!fe) {

            errno = EBADF;
            return -1;

      }

      if (fe->file != False) { /* FIXME, should be dir, perhaps */

            errno = ENOTDIR;
            return -1;

      }

      /*
       * This causes problems on some UNIXens ... wonder who is using
       * it ... FIXME.
       */
      return (off_t) fe->dir_next;

}


Generated by  Doxygen 1.6.0   Back to index