1DPNS_CREAT(3) DPNS Library Functions DPNS_CREAT(3)
2
3
4
6 dpns_creat - create a new DPNS file or reset it in the name server
7
9 #include <sys/types.h>
10 #include "dpns_api.h"
11
12 int dpns_creat (const char *path, mode_t mode)
13
14 int dpns_creatx (const char *path, mode_t mode, struct dpns_fileid
15 *file_uniqueid)
16
18 dpns_creat creates a new DPNS file or resets it in the name server.
19
20 If the file exists, the length is truncated to 0 and the mode and owner
21 are unchanged.
22
23 If the file does not exist yet, an entry is created in the name server
24 database and the file's owner ID is set to the effective user ID of the
25 requestor. The group ID of the file is set to the effective group ID
26 of the requestor or is taken from the parent directory if the latter
27 has the S_ISGID bit set.
28
29 The access permission bits for the file are taken from mode, then all
30 bits set in the requestor's file mode creation mask are cleared (see
31 dpns_umask(3)).
32
33 dpns_creatx behaves in the same way and returns the file unique id
34 (name server hostname and file id).
35
36 path specifies the logical pathname relative to the current DPNS
37 directory or the full DPNS pathname.
38
40 This routine returns 0 if the operation was successful or -1 if the
41 operation failed. In the latter case, serrno is set appropriately.
42
44 ENOENT A component of path prefix does not exist or path is a
45 null pathname.
46
47 EACCES Search permission is denied on a component of the path
48 prefix or the file does not exist and write permission on
49 the parent directory is denied or the file exists and
50 write permission on the file itself is denied.
51
52 EFAULT path or file_uniqueid is a NULL pointer.
53
54 EEXIST File exists already and has replicas.
55
56 ENOTDIR A component of path prefix is not a directory.
57
58 EISDIR path is an existing directory.
59
60 EINVAL The fileclass in the parent directory is zero.
61
62 ENOSPC The name server database is full.
63
64 ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of
65 a path component exceeds CA_MAXNAMELEN.
66
67 SENOSHOST Host unknown.
68
69 SENOSSERV Service unknown.
70
71 SECOMERR Communication error.
72
73 ENSNACT Name server is not running or is being shutdown.
74
76 Castor_limits(4), dpns_chdir(3), dpns_chmod(3),
77 dpns_stat(3), dpns_statg(3), dpns_umask(3)
78
80 LCG Grid Deployment Team
81
82
83
84DPNS $Date: 2005/06/30 08:34:03 $ DPNS_CREAT(3)