1DPNS_ACCESSR(3)             DPNS Library Functions             DPNS_ACCESSR(3)
2
3
4

NAME

6       dpns_accessr - check existence/accessibility of a file replica
7

SYNOPSIS

9       Under Unix:
10       #include <sys/types.h>
11       #include <unistd.h>
12       #include "dpns_api.h"
13
14       Under Windows/NT:
15       #include <sys/types.h>
16       #define R_OK 4
17       #define W_OK 2
18       #define X_OK 1
19       #define F_OK 0
20       #include "dpns_api.h"
21
22       int dpns_accessr (const char *sfn, int amode);
23

DESCRIPTION

25       dpns_accessr  checks  in  the name server database the existence or the
26       accessibility of the file replica sfn according to the bit  pattern  in
27       amode using the real user ID.
28
29       sfn    is  either  the  Site  URL  or  the  Physical  File Name for the
30              replica.
31
32       amode  the bit pattern is built by an OR of the  constants  defined  in
33              <unistd.h>  under  Unix  or  to be explicitly defined under Win‐
34              dows/NT:
35
36              R_OK   test for read permission
37
38              W_OK   test for write permission
39
40              X_OK   test for search/execute permission
41
42              F_OK   test for existence of the file.
43

RETURN VALUE

45       This routine returns 0 if the operation was successful  or  -1  if  the
46       operation failed. In the latter case, serrno is set appropriately.
47

ERRORS

49       ENOENT       The named file does not exist.
50
51       EACCES       Search  permission  is denied on a component of the parent
52                    file prefix, the specified access to the  file  itself  is
53                    denied  or W_OK is requested but the replica status is not
54                    'P' (cannot modify an existing file).
55
56       EFAULT       sfn is a NULL pointer.
57
58       EINVAL       amode is invalid.
59
60       ENAMETOOLONG The length of sfn exceeds CA_MAXSFNLEN.
61
62       SENOSHOST    Host unknown.
63
64       SENOSSERV    Service unknown.
65
66       SECOMERR     Communication error.
67
68       ENSNACT      Name server is not running or is being shutdown.
69

SEE ALSO

71       Castor_limits(4), dpns_chmod(3), dpns_statr(3)
72

AUTHOR

74       LCG Grid Deployment Team
75
76
77
78DPNS         $Date: 2010-04-05 09:51:26 +0200 (Mon, 05 Apr 2010)DP$NS_ACCESSR(3)
Impressum