1DPNS_READDIRXP(3)            DPNS Library Functions           DP‐
2NS_READDIRXP(3)
3
4
5
6[1mNAME[0m
7       dpns_readdirxp ‐ 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_direnrep    *dpns_readdirxp    (dpns_DIR
16*[4m[22mdirp[24m[1m,  char  *[4m[22mpattern[24m[1m,[0m
17       [1mchar *[4m[22mse[24m[1m)[0m
18
19[1mDESCRIPTION[0m
20       [1mdpns_readdirxp  [22mreads  the DPNS directory opened by
21[1mdpns_opendir [22min the
22       name  server.   It  does  restricted  pattern matching  on
23basename.   This
24       routine  returns a pointer to a structure  containing  the
25current direc‐
26       tory  entry  (basename, guid and filesize) and the replica
27information.
28
29       struct dpns_rep_info {
30            u_signed64     fileid;
31            char      status;
32            char      *host;
33            char      *sfn;
34       };
35
36       struct dpns_direnrep {
37            u_signed64     fileid;
38            char      guid[CA_MAXGUIDLEN+1];
39            mode_t         filemode;
40            u_signed64     filesize;
41            int       nbreplicas;
42            struct dpns_rep_info *rep;    /* array of replica in‐
43fo structures */
44            unsigned short d_reclen; /* length of this entry */
45            char       d_name[1];      /*  basename  in  variable
46length */
47       };
48
49       [1mdpns_readdirxp [22mcaches a variable number of such en‐
50tries,  depending  on
51       the   filename   size,   to   minimize  the  number of re‐
52quests to the name
53       server.
54
55       [4mdirp[24m   specifies  the  pointer  value  returned  by
56[1mdpns_opendir[22m.
57
58       [4mpattern[0m
59              allows  to  restrict the listing to entries  having
60the  basename
61              starting with this pattern.
62
63       [4mse[24m     allows to restrict the replica entries to  a
64given SE.
65
66[1mRETURN VALUE[0m
67       This   routine  returns  a pointer to a structure contain‐
68ing the current
69       directory entry if the operation was successful or NULL if
70the  end  of
71       the   directory   was  reached or if the operation failed.
72When the end of
73       the directory is encountered, serrno is  not  changed.  If
74the  operation
75       failed, [1mserrno [22mis set appropriately.
76
77       As   dpns_readdirxp returns a null pointer both at the end
78of the direc‐
79       tory and on error, an application wishing to check for er‐
80ror situations
81       should  set  [1mserrno [22mto 0, then call dpns_readdirxp,
82then check [1mserrno [22mand
83       if it is non‐zero, assume an error has occurred.
84
85[1mERRORS[0m
86       [1mEBADF        [22mFile descriptor in  DIR  structure  is
87invalid.
88
89       [1mENOMEM        [22mMemory could not be allocated for un‐
90marshalling the reply.
91
92       [1mEFAULT       [4m[22mdirp[24m is a NULL pointer.
93
94       [1mEINVAL       [22mThe length of  [4mpattern[24m  exceeds
95[1mCA_MAXNAMELEN [22mor the  length
96                    of   [4mse[24m   exceeds   [1mCA_MAXHOSTNAME‐
97LEN[22m.
98
99       [1mSECOMERR     [22mCommunication error.
100
101       [1mENSNACT      [22mName server is not running or is being
102shutdown.
103
104[1mSEE ALSO[0m
105       [1mdpns_closedir(3)[22m,   [1mdpns_opendir(3)[22m,  [1mdp‐
106ns_rewinddir(3)[0m
107
108[1mAUTHOR[0m
109       [1mLCG Grid Deployment [22mTeam
110
111
112
113DPNS                                $Date$                    DP‐
114NS_READDIRXP(3)
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Impressum