466
|
1 <refentry id="chmod">
|
|
2 <refnamediv>
|
468
|
3 <refname>Chmod</refname>
|
|
4 <refpurpose>change access permissions of a file</refpurpose>
|
466
|
5 </refnamediv>
|
|
6
|
|
7 <refsynopsisdiv>
|
|
8 <funcsynopsis>
|
468
|
9 <funcsynopsisinfo>
|
|
10 #include <modes.h>
|
|
11 </funcsynopsisinfo>
|
466
|
12 <funcprototype>
|
|
13 <funcdef><function>chmod</function></funcdef>
|
472
|
14 <paramdef>char *<parameter>fname</parameter></paramdef>
|
|
15 <paramdef>int <parameter>perm</parameter></paramdef>
|
466
|
16 </funcprototype>
|
|
17 </funcsynopsis>
|
|
18
|
|
19 </refsynopsisdiv>
|
|
20
|
|
21 <refsect1><title>Description</title>
|
|
22 <para>
|
594
|
23 Chmod changes the permission bits associated with a file.
|
|
24 "Fname" must be a pointer to a file name, and "perm" should
|
|
25 contain the desired bit pattern,
|
|
26 </para>
|
|
27 <para>
|
|
28 The allowable bit patterns are defined in the include file as follows:
|
|
29 </para>
|
|
30 <programlisting>
|
|
31 /* permissions */
|
|
32 #define S_IREAD 0x01 /* owner read */
|
|
33 #define S_IWRITE 0x02 /* owner write */
|
|
34 #define S_IEXEC 0x04 /* owner execute */
|
|
35 #define S_IOREAD 0x08 /* public read */
|
|
36 #define S_IOWRITE 0x10 /* public write */
|
|
37 #define S_IOEXEC 0x20 /* public execute */
|
|
38 #define S_ISHARE 0x40 /* sharable */
|
|
39 #define S_IFDIR 0x80 /* directory */
|
|
40 </programlisting>
|
|
41 <para>
|
|
42 Only the owner or the super user may change the permissions of
|
|
43 a file.
|
466
|
44 </para>
|
|
45 </refsect1>
|
594
|
46
|
552
|
47 <refsect1><title>Diagnostics</title>
|
|
48 <para>
|
|
49 A successful call returns 0. A -1 is returned if the
|
|
50 caller is not entitled to change permissions of "fname" cannot
|
|
51 be found.
|
|
52 </para>
|
|
53 </refsect1>
|
|
54
|
594
|
55 <refsect1><title>See Also</title>
|
|
56 <para>
|
|
57 OS-9 command "attr"
|
|
58 </para>
|
|
59 </refsect1>
|
|
60
|
466
|
61 </refentry>
|