1DPNS_ACCESSR(3) DPNS Library Functions
2DPNS_ACCESSR(3)
3
4
5
6[1mNAME[0m
7 dpns_accessr ‐ check existence/accessibility of a file
8replica
9
10[1mSYNOPSIS[0m
11 Under Unix:
12 [1m#include <sys/types.h>[0m
13 [1m#include <unistd.h>[0m
14 [1m#include "dpns_api.h"[0m
15
16 Under Windows/NT:
17 [1m#include <sys/types.h>[0m
18 [1m#define R_OK 4[0m
19 [1m#define W_OK 2[0m
20 [1m#define X_OK 1[0m
21 [1m#define F_OK 0[0m
22 [1m#include "dpns_api.h"[0m
23
24 [1mint dpns_accessr (const char *[4m[22msfn[24m[1m, int
25[4m[22mamode[24m[1m);[0m
26
27[1mDESCRIPTION[0m
28 [1mdpns_accessr [22mchecks in the name server database
29the existence or the
30 accessibility of the file replica [4msfn[24m according to
31the bit pattern in
32 [4mamode[24m using the real user ID.
33
34 [4msfn[24m is either the Site URL or the Physi‐
35cal File Name for the
36 replica.
37
38 [4mamode[24m the bit pattern is built by an OR of the
39constants defined in
40 <[1munistd.h[22m> under Unix or to be explicit‐
41ly defined under Win‐
42 dows/NT:
43
44 [1mR_OK [22mtest for read permission
45
46 [1mW_OK [22mtest for write permission
47
48 [1mX_OK [22mtest for search/execute permission
49
50 [1mF_OK [22mtest for existence of the file.
51
52[1mRETURN VALUE[0m
53 This routine returns 0 if the operation was successful or
54‐1 if the
55 operation failed. In the latter case, [1mserrno [22mis set
56appropriately.
57
58[1mERRORS[0m
59 [1mENOENT [22mThe named file does not exist.
60
61 [1mEACCES [22mSearch permission is denied on a
62component of the parent
63 file prefix, the specified access to the
64file itself is
65 denied or W_OK is requested but the replica
66status is not
67 ’P’ (cannot modify an existing file).
68
69 [1mEFAULT [4m[22msfn[24m is a NULL pointer.
70
71 [1mEINVAL [4m[22mamode[24m is invalid.
72
73 [1mENAMETOOLONG [22mThe length of [4msfn[24m exceeds
74[1mCA_MAXSFNLEN[22m.
75
76 [1mSENOSHOST [22mHost unknown.
77
78 [1mSENOSSERV [22mService unknown.
79
80 [1mSECOMERR [22mCommunication error.
81
82 [1mENSNACT [22mName server is not running or is being
83shutdown.
84
85[1mSEE ALSO[0m
86 [1mCastor_limits(4)[22m, [1mdpns_chmod(3)[22m, [1mdp‐
87ns_statr(3)[0m
88
89[1mAUTHOR[0m
90 [1mLCG Grid Deployment [22mTeam
91
92
93
94DPNS $Date$
95DPNS_ACCESSR(3)
96
97
98
99
100
101
102
103
104
105
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