1RFIO_CHMOD(3) Rfio Library Functions RFIO_CHMOD(3)
2
3
4
6 rfio_chmod, rfio_fchmod - change access mode of a directory/file
7
9 #include <sys/types.h>
10 #include "rfio_api.h"
11
12 int rfio_chmod (const char *path, mode_t mode);
13 int rfio_fchmod (int s, mode_t mode);
14
16 rfio_chmod sets the access permission portion of the mode of a direc‐
17 tory/file to the bit pattern in mode.
18
19 rfio_fchmod is identical to rfio_chmod but works on the file descriptor
20 s returned by rfio_open.
21
22 path specifies the logical pathname relative to the current directory
23 or the full pathname.
24
25 mode is constructed by OR'ing the bits defined in <sys/stat.h> under
26 Unix or "statbits.h" under Windows/NT:
27
28 S_IRUSR 0000400 read by owner
29 S_IWUSR 0000200 write by owner
30 S_IXUSR 0000100 execute/search by owner
31 S_IRGRP 0000040 read by group
32 S_IWGRP 0000020 write by group
33 S_IXGRP 0000010 execute/search by group
34 S_IROTH 0000004 read by others
35 S_IWOTH 0000002 write by others
36 S_IXOTH 0000001 execute/search by others
37
38 The effective user ID of the process must match the owner of the file
39 or be super-user. If a directory is writable and has the sticky bit
40 set, files/directories within that directory can be removed or renamed
41 only if:
42
43 the effective user ID of the requestor matches the owner ID of
44 the file or
45
46 the effective user ID of the requestor matches the owner ID of
47 the directory or
48
49 the file is writable by the requestor or
50
51 the requestor is super-user.
52
54 This routine returns 0 if the operation was successful or -1 if the
55 operation failed. In the latter case, serrno is set appropriately.
56
58 EPERM The effective user ID does not match the owner of the file
59 and is not super-user.
60
61 ENOENT The named file/directory does not exist or is a null path‐
62 name.
63
64 EBADF s is not a valid file descriptor.
65
66 EACCES Search permission is denied on a component of the path
67 prefix or write permission on the file itself is denied.
68
69 EFAULT path is a NULL pointer.
70
71 ENOTDIR A component of path prefix is not a directory.
72
73 ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of
74 a path component exceeds CA_MAXNAMELEN.
75
76 SENOSHOST Host unknown.
77
78 SENOSSERV Service unknown.
79
80 SECOMERR Communication error.
81
83 Castor_limits(4)
84
86 LCG Grid Deployment Team
87
88
89
90LCG $Date: 2005/03/31 13:13:02 $ RFIO_CHMOD(3)