1DPM_COPY(3) DPM Library Functions DPM_COPY(3)
2
3
4
6 dpm_copy - copy a set of existing files
7
9 #include <sys/types.h>
10 #include "dpm_api.h"
11
12 int dpm_copy (int nbreqfiles, struct dpm_copyfilereq *reqfiles, char
13 *u_token, int flags, time_t retrytime, char *r_token, int *nbreplies,
14 struct dpm_copyfilestatus **filestatuses)
15
17 dpm_copy copies a set of existing files.
18
19 The input arguments are:
20
21 nbreqfiles
22 specifies the number of files belonging to the request.
23
24 reqfiles
25 specifies the array of file requests (dpm_copyfilereq struc‐
26 tures).
27
28 struct dpm_copyfilereq {
29 char *from_surl;
30 char *to_surl;
31 time_t lifetime;
32 char f_type;
33 char s_token[CA_MAXDPMTOKENLEN+1];
34 char ret_policy;
35 char ac_latency;
36 int flags;
37 };
38
39 u_token
40 specifies the user provided description associated with the
41 request.
42
43 flags if set to non zero, it allows to overwrite an existing file.
44
45 retrytime
46 This field is currently ignored.
47
48 The output arguments are:
49
50 r_token
51 Address of a buffer to receive the system allocated token. The
52 buffer must be at least CA_MAXDPMTOKENLEN+1 characters long.
53
54 nbreplies
55 will be set to the number of replies in the array of file sta‐
56 tuses.
57
58 filestatuses
59 will be set to the address of an array of dpm_copyfilestatus
60 structures allocated by the API. The client application is
61 responsible for freeing the array when not needed anymore.
62
63 struct dpm_copyfilestatus {
64 char *from_surl;
65 char *to_surl;
66 u_signed64 filesize;
67 int status;
68 char *errstring;
69 time_t f_lifetime;
70 };
71
73 This routine returns 0 if the operation was successful or -1 if the
74 operation failed. In the latter case, serrno is set appropriately.
75
77 EFAULT reqfiles, r_token, nbreplies or filestatuses is a NULL
78 pointer.
79
80 ENOMEM Memory could not be allocated for marshalling the request.
81
82 EINVAL nbreqfiles is not strictly positive, the length of the
83 user request description is greater than 255 or all file
84 requests have errors.
85
86 SENOSHOST Host unknown.
87
88 SEINTERNAL Database error.
89
90 SECOMERR Communication error.
91
92
93
94LCG $Date: 2006/12/20 15:21:57 $ DPM_COPY(3)