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