1DPM_COPY(3) DPM Library Functions
2DPM_COPY(3)
3
4
5
6[1mNAME[0m
7 dpm_copy ‐ copy a set of existing files
8
9[1mSYNOPSIS[0m
10 [1m#include <sys/types.h>[0m
11 [1m#include "dpm_api.h"[0m
12
13 [1mint dpm_copy (int [4m[22mnbreqfiles[24m[1m, struct
14dpm_copyfilereq *[4m[22mreqfiles[24m[1m, char[0m
15 [1m*[4m[22mu_token[24m[1m, int [4m[22mflags[24m[1m, time_t
16[4m[22mretrytime[24m[1m, char *[4m[22mr_token[24m[1m, int
17*[4m[22mnbreplies[24m[1m,[0m
18 [1mstruct dpm_copyfilestatus **[4m[22mfilestatus‐
19es[24m[1m)[0m
20
21[1mDESCRIPTION[0m
22 [1mdpm_copy [22mcopies a set of existing files.
23
24 The input arguments are:
25
26 [4mnbreqfiles[0m
27 specifies the number of files belonging to the re‐
28quest.
29
30 [4mreqfiles[0m
31 specifies the array of file requests (dpm_copy‐
32filereq struc‐
33 tures).
34
35 struct dpm_copyfilereq {
36 char *from_surl;
37 char *to_surl;
38 time_t lifetime;
39 char f_type;
40 char s_token[CA_MAXDPMTOKENLEN+1];
41 char ret_policy;
42 char ac_latency;
43 int flags;
44 };
45
46 [4mu_token[0m
47 specifies the user provided description associ‐
48ated with the
49 request.
50
51 [4mflags[24m if set to non zero, it allows to overwrite
52an existing file.
53
54 [4mretrytime[0m
55 This field is currently ignored.
56
57 The output arguments are:
58
59 [4mr_token[0m
60 Address of a buffer to receive the system allocat‐
61ed token. The
62 buffer must be at least CA_MAXDPMTOKENLEN+1 charac‐
63ters long.
64
65 [4mnbreplies[0m
66 will be set to the number of replies in the array
67of file sta‐
68 tuses.
69
70 [4mfilestatuses[0m
71 will be set to the address of an array of
72dpm_copyfilestatus
73 structures allocated by the API. The client
74application is
75 responsible for freeing the array when not needed
76anymore.
77
78 struct dpm_copyfilestatus {
79 char *from_surl;
80 char *to_surl;
81 u_signed64 filesize;
82 int status;
83 char *errstring;
84 time_t f_lifetime;
85 };
86
87[1mRETURN VALUE[0m
88 This routine returns 0 if the operation was successful
89or ‐1 if the
90 operation failed. In the latter case, [1mserrno [22mis set
91appropriately.
92
93[1mERRORS[0m
94 [1mEFAULT [4m[22mreqfiles[24m, [4mr_token[24m, [4mn‐
95breplies[24m or [4mfilestatuses[24m is a NULL
96 pointer.
97
98 [1mENOMEM [22mMemory could not be allocated for mar‐
99shalling the request.
100
101 [1mEINVAL [4m[22mnbreqfiles[24m is not strictly
102positive, the length of the
103 user request description is greater than 255
104or all file
105 requests have errors.
106
107 [1mSENOSHOST [22mHost unknown.
108
109 [1mSEINTERNAL [22mDatabase error.
110
111 [1mSECOMERR [22mCommunication error.
112
113
114
115LCG $Date: 2006/12/20 15:21:57 $
116DPM_COPY(3)
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132