1LFC_CREATG(3) LFC Library Functions LFC_CREATG(3)
2
3
4
6 lfc_creatg - create a new LFC file with the specified GUID or reset it
7 in the name server
8
10 #include <sys/types.h>
11 #include "lfc_api.h"
12
13 int lfc_creatg (const char *path, const char *guid, mode_t mode)
14
16 lfc_creatg creates a new LFC file with the specified GUID or resets it
17 in the name server.
18
19 If the file exists, the length is truncated to 0 and the mode and owner
20 are unchanged.
21
22 If the file does not exist yet, an entry is created in the name server
23 database and the file's owner ID is set to the effective user ID of the
24 requestor. The group ID of the file is set to the effective group ID
25 of the requestor or is taken from the parent directory if the latter
26 has the S_ISGID bit set.
27
28 The access permission bits for the file are taken from mode, then all
29 bits set in the requestor's file mode creation mask are cleared (see
30 lfc_umask(3)).
31
32 guid specifies the Grid Unique IDentifier.
33
34 path specifies the logical pathname relative to the current LFC
35 directory or the full LFC pathname.
36
38 This routine returns 0 if the operation was successful or -1 if the
39 operation failed. In the latter case, serrno is set appropriately.
40
42 ENOENT A component of path prefix does not exist or path is a
43 null pathname.
44
45 EACCES Search permission is denied on a component of the path
46 prefix or the file does not exist and write permission on
47 the parent directory is denied or the file exists and
48 write permission on the file itself is denied.
49
50 EFAULT path is a NULL pointer.
51
52 EEXIST File exists already with a different GUID or has replicas.
53
54 ENOTDIR A component of path prefix is not a directory.
55
56 EISDIR path is an existing directory.
57
58 EINVAL The fileclass in the parent directory is zero or the
59 length of the guid exceeds CA_MAXGUIDLEN.
60
61 ENOSPC The name server database is full.
62
63 ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of
64 a path component exceeds CA_MAXNAMELEN.
65
66 SENOSHOST Host unknown.
67
68 SENOSSERV Service unknown.
69
70 SECOMERR Communication error.
71
72 ENSNACT Name server is not running or is being shutdown.
73
75 Castor_limits(4), lfc_chdir(3), lfc_chmod(3), lfc_statg(3),
76 lfc_umask(3)
77
79 LCG Grid Deployment Team
80
81
82
83LFC $Date: 2010-12-08 11:48:14 +0100 (Wed, 08 Dec 2010) $LFC_CREATG(3)