1LFC_REGISTERFILES(3) LFC Library Functions
2LFC_REGISTERFILES(3)
3
4
5
6[1mNAME[0m
7 lfc_registerfiles ‐ register list of files with their
8corresponding
9 replica entry
10
11[1mSYNOPSIS[0m
12 [1m#include <sys/types.h>[0m
13 [1m#include "lfc_api.h"[0m
14
15 [1mint lfc_registerfiles (int [4m[22mnbfiles[24m[1m,
16struct lfc_filereg *[4m[22mfiles[24m[1m, int[0m
17 [1m*[4m[22mnbstatuses[24m[1m, int **[4m[22mstatus‐
18es[24m[1m)[0m
19
20[1mDESCRIPTION[0m
21 [1mlfc_registerfiles [22mregisters a list of files with
22their corresponding
23 replica entry. If the lfn is already registered, the guid
24is optional
25 and only the replica is added (after checking that file‐
26size and possi‐
27 bly checksum match). If the lfn is not registered yet,
28the guid is
29 mandatory for the LFC. The lfn and the replica get regis‐
30tered.
31
32 [4mnbfiles[0m
33 specifies the number of files in the array
34[4mfiles[24m.
35
36 [4mfiles[24m is a pointer to an array of lfc_filereg
37structures provided by
38 the application.
39
40 struct lfc_filereg {
41 char *lfn;
42 char *guid;
43 mode_t mode;
44 u_signed64 size;
45 char *csumtype;
46 char *csumvalue;
47 char *server;
48 char *sfn;
49 };
50
51 [4mnbstatuses[0m
52 will be set to the number of replies in the array
53of statuses.
54
55 [4mstatuses[0m
56 will be set to the address of an array of integer
57statuses allo‐
58 cated by the API. The client application is
59responsible for
60 freeing the array when not needed anymore. Indi‐
61vidual statuses
62 are 0 if the operation was successful or set to the
63serrno value
64 in case of error.
65
66[1mRETURN VALUE[0m
67 This routine returns 0 if the operation was successful or
68‐1 if the
69 operation failed. In the latter case, [1mserrno [22mis set
70appropriately.
71
72[1mERRORS[0m
73 [1mENOENT [22mA component of [4mlfn[24m prefix does
74not exist or [4mlfn[24m is a null
75 pathname.
76
77 [1mE2BIG [22mRequest too large (max 1 MB).
78
79 [1mENOMEM [22mMemory could not be allocated for mar‐
80shalling the request
81 or unmarshalling the reply.
82
83 [1mEACCES [22mSearch permission is denied on a com‐
84ponent of the [4mlfn[24m pre‐
85 fix or the file does not exist and write per‐
86mission on the
87 parent directory is denied or write permis‐
88sion on the file
89 itself is denied.
90
91 [1mEFAULT [4m[22mfiles[24m, [4mnbstatuses[24m or
92[4mstatuses[24m is a NULL pointer.
93
94 [1mEEXIST [22mThe [4msfn[24m exists already.
95
96 [1mENOTDIR [22mA component of [4mlfn[24m prefix is
97not a directory.
98
99 [1mEISDIR [22mThe [4mlfn[24m exists already and is
100not a regular file.
101
102 [1mEINVAL [4m[22mnbfiles[24m is not strictly posi‐
103tive, the length of one of the
104 [4mguids[24m exceeds [1mCA_MAXGUIDLEN
105[22mor the length of [4mserver[0m
106 exceeds [1mCA_MAXHOSTNAMELEN [22mor lfn and
107guid are both given
108 and they point at a different file.
109
110 [1mENOSPC [22mThe name server database is full.
111
112 [1mENAMETOOLONG [22mThe length of [4mlfn[24m exceeds
113[1mCA_MAXPATHLEN [22mor the length of
114 an [4mlfn[24m component exceeds [1mCA_MAX‐
115NAMELEN [22mor the length of
116 [4msfn[24m exceeds [1mCA_MAXSFNLEN[22m.
117
118 [1mSENOSSERV [22mService unknown.
119
120 [1mSEINTERNAL [22mDatabase error.
121
122 [1mSECOMERR [22mCommunication error.
123
124 [1mENSNACT [22mName server is not running or is being
125shutdown.
126
127[1mSEE ALSO[0m
128 [1mCastor_limits(4)[22m, [1mlfc_addreplica(3)[22m,
129[1mlfc_creatg(3)[22m, [1mlfc_setfsize(3)[0m
130
131[1mAUTHOR[0m
132 [1mLCG Grid Deployment [22mTeam
133
134
135
136LFC $Date$
137LFC_REGISTERFILES(3)
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198