1DPNS_READDIRG(3)            DPNS Library Functions            DP‐
2NS_READDIRG(3)
3
4
5
6[1mNAME[0m
7       dpns_readdir  ‐  read  DPNS  directory  opened  by  [1mdp‐
8ns_opendir [22min the name
9       server
10
11[1mSYNOPSIS[0m
12       [1m#include <sys/types.h>[0m
13       [1m#include "dpns_api.h"[0m
14
15       [1mstruct    dpns_direnstatg    *dpns_readdir    (dpns_DIR
16*[4m[22mdirp[24m[1m)[0m
17
18[1mDESCRIPTION[0m
19       [1mdpns_readdir [22mreads the DPNS  directory  opened   by
20[1mdpns_opendir  [22min  the
21       name   server.  This routine returns a pointer to a struc‐
22ture containing
23       the current directory entry including the GUID associated.
24
25       struct dpns_direnstatg {
26            u_signed64     fileid;
27            char      guid[CA_MAXGUIDLEN+1];
28            mode_t         filemode;
29            int       nlink;         /* number of files in a  di‐
30rectory */
31            uid_t          uid;
32            gid_t          gid;
33            u_signed64     filesize;
34            time_t          atime;         /* last access to file
35*/
36            time_t         mtime;         /* last file  modifica‐
37tion */
38            time_t          ctime;         /* last metadata modi‐
39fication */
40            short          fileclass;     /* not used */
41            char      status;        /* ’ ’ ‐‐> online,  ’m’  ‐‐>
42migrated */
43            char      csumtype[3];   /* "CS", "AD" or "MD" */
44            char      csumvalue[33];
45            unsigned short d_reclen; /* length of this entry */
46            char       d_name[1];      /*  basename  in  variable
47length */
48       };
49
50       [1mdpns_readdir [22mcaches a variable number of  such  en‐
51tries, depending on the
52       filename  size,  to minimize the number of requests to the
53name server.
54
55       [4mdirp[24m   specifies  the  pointer  value  returned  by
56[1mdpns_opendir[22m.
57
58[1mRETURN VALUE[0m
59       This   routine  returns  a pointer to a structure contain‐
60ing the current
61       directory entry if the operation was successful or NULL if
62the  end  of
63       the   directory   was  reached or if the operation failed.
64When the end of
65       the directory is encountered, serrno is  not  changed.  If
66the  operation
67       failed, [1mserrno [22mis set appropriately.
68
69       As  dpns_readdir returns a null pointer both at the end of
70the directory
71       and on error, an application wishing  to  check  for   er‐
72ror  situations
73       should   set   [1mserrno [22mto 0, then call dpns_readdir,
74then check [1mserrno [22mand
75       if it is non‐zero, assume an error has occurred.
76
77[1mERRORS[0m
78       [1mEBADF        [22mFile descriptor in  DIR  structure  is
79invalid.
80
81       [1mEFAULT       [4m[22mdirp[24m is a NULL pointer.
82
83       [1mSECOMERR     [22mCommunication error.
84
85       [1mENSNACT      [22mName server is not running or is being
86shutdown.
87
88[1mSEE ALSO[0m
89       [1mdpns_closedir(3)[22m,  [1mdpns_opendir(3)[22m,   [1mdp‐
90ns_rewinddir(3)[0m
91
92[1mAUTHOR[0m
93       [1mLCG Grid Deployment [22mTeam
94
95
96
97DPNS                                $Date$                    DP‐
98NS_READDIRG(3)
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Impressum