1DPNS_READDIRG(3)            DPNS Library Functions            DPNS_READDIRG(3)
2
3
4

NAME

6       dpns_readdir  -  read DPNS directory opened by dpns_opendir in the name
7       server
8

SYNOPSIS

10       #include <sys/types.h>
11       #include "dpns_api.h"
12
13       struct dpns_direnstatg *dpns_readdir (dpns_DIR *dirp)
14

DESCRIPTION

16       dpns_readdir reads the DPNS directory opened  by  dpns_opendir  in  the
17       name  server.  This routine returns a pointer to a structure containing
18       the current directory entry including the GUID associated.
19
20       struct dpns_direnstatg {
21            u_signed64     fileid;
22            char      guid[CA_MAXGUIDLEN+1];
23            mode_t         filemode;
24            int       nlink;         /* number of files in a directory */
25            uid_t          uid;
26            gid_t          gid;
27            u_signed64     filesize;
28            time_t         atime;         /* last access to file */
29            time_t         mtime;         /* last file modification */
30            time_t         ctime;         /* last metadata modification */
31            short          fileclass;     /* not used */
32            char      status;        /* ' ' --> online, 'm' --> migrated */
33            char      csumtype[3];   /* "CS", "AD" or "MD" */
34            char      csumvalue[33];
35            unsigned short d_reclen; /* length of this entry */
36            char      d_name[1];     /* basename in variable length */
37       };
38
39       dpns_readdir caches a variable number of such entries, depending on the
40       filename size, to minimize the number of requests to the name server.
41
42       dirp   specifies the pointer value returned by dpns_opendir.
43

RETURN VALUE

45       This  routine  returns  a pointer to a structure containing the current
46       directory entry if the operation was successful or NULL if the  end  of
47       the  directory  was reached or if the operation failed. When the end of
48       the directory is encountered, serrno is not changed. If  the  operation
49       failed, serrno is set appropriately.
50
51       As dpns_readdir returns a null pointer both at the end of the directory
52       and on error, an application wishing  to  check  for  error  situations
53       should  set  serrno to 0, then call dpns_readdir, then check serrno and
54       if it is non-zero, assume an error has occurred.
55

ERRORS

57       EBADF        File descriptor in DIR structure is invalid.
58
59       EFAULT       dirp is a NULL pointer.
60
61       SENOSHOST    Host unknown.
62
63       SENOSSERV    Service unknown.
64
65       SECOMERR     Communication error.
66
67       ENSNACT      Name server is not running or is being shutdown.
68

SEE ALSO

70       dpns_closedir(3), dpns_opendir(3), dpns_rewinddir(3)
71

AUTHOR

73       LCG Grid Deployment Team
74
75
76
77DPNS                     $Date: 2006/03/16 13:02:57 $         DPNS_READDIRG(3)
Impressum