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