1LFC_READDIRXR(3) LFC Library Functions
2LFC_READDIRXR(3)
3
4
5
6[1mNAME[0m
7 lfc_readdirxr ‐ 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_readdirxr (lfc_DIR
16*[4m[22mdirp[24m[1m, char *[4m[22mse[24m[1m)[0m
17
18[1mDESCRIPTION[0m
19 [1mlfc_readdirxr [22mreads the LFC directory opened by
20[1mlfc_opendir [22min the name
21 server. This routine returns a pointer to a structure
22containing the
23 current directory entry (basename, guid and filesize) and
24the replica
25 information.
26
27 struct lfc_rep_info {
28 u_signed64 fileid;
29 char status;
30 char *host;
31 char *sfn;
32 };
33
34 struct lfc_direnrep {
35 u_signed64 fileid;
36 char guid[CA_MAXGUIDLEN+1];
37 mode_t filemode;
38 u_signed64 filesize;
39 int nbreplicas;
40 struct lfc_rep_info *rep; /* array of replica in‐
41fo structures */
42 unsigned short d_reclen; /* length of this entry */
43 char d_name[1]; /* basename in variable
44length */
45 };
46
47 [1mlfc_readdirxr [22mcaches a variable number of such
48entries, depending on
49 the filename size, to minimize the number of requests
50to the name
51 server.
52
53 [4mdirp[24m specifies the pointer value returned by
54[1mlfc_opendir[22m.
55
56 [4mse[24m allows to restrict the replica entries to a
57given SE.
58
59[1mRETURN VALUE[0m
60 This routine returns a pointer to a structure contain‐
61ing the current
62 directory entry if the operation was successful or NULL if
63the end of
64 the directory was reached or if the operation failed.
65When the end of
66 the directory is encountered, serrno is not changed. If
67the operation
68 failed, [1mserrno [22mis set appropriately.
69
70 As lfc_readdirxr returns a null pointer both at the end
71of the direc‐
72 tory and on error, an application wishing to check for er‐
73ror situations
74 should set [1mserrno [22mto 0, then call lfc_readdirxr,
75then check [1mserrno [22mand
76 if it is non‐zero, assume an error has occurred.
77
78[1mERRORS[0m
79 [1mEBADF [22mFile descriptor in DIR structure is
80invalid.
81
82 [1mENOMEM [22mMemory could not be allocated for un‐
83marshalling the reply.
84
85 [1mEFAULT [4m[22mdirp[24m is a NULL pointer.
86
87 [1mEINVAL [22mThe length of [4mse[24m exceeds
88[1mCA_MAXHOSTNAMELEN[22m.
89
90 [1mSECOMERR [22mCommunication error.
91
92 [1mENSNACT [22mName server is not running or is being
93shutdown.
94
95[1mSEE ALSO[0m
96 [1mlfc_closedir(3)[22m, [1mlfc_opendirg(3)[22m,
97[1mlfc_rewinddir(3)[0m
98
99[1mAUTHOR[0m
100 [1mLCG Grid Deployment [22mTeam
101
102
103
104LFC $Date$
105LFC_READDIRXR(3)
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