Mercurial > hg > Members > kono > nitros9-code
view docs/ccguide/chmod.refentry @ 2342:82c9672489a0
Made change to workings of SHARE. bit to what I believe is the proper way.
author | boisy |
---|---|
date | Fri, 15 Jan 2010 15:54:53 +0000 |
parents | c0da1728ed5b |
children |
line wrap: on
line source
<refentry id="chmod"> <refnamediv> <refname>Chmod</refname> <refpurpose>change access permissions of a file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> #include <modes.h> </funcsynopsisinfo> <funcprototype> <funcdef><function>chmod</function></funcdef> <paramdef>char *<parameter>fname</parameter></paramdef> <paramdef>int <parameter>perm</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1><title>Description</title> <para> Chmod changes the permission bits associated with a file. "Fname" must be a pointer to a file name, and "perm" should contain the desired bit pattern, </para> <para> The allowable bit patterns are defined in the include file as follows: </para> <programlisting> /* permissions */ #define S_IREAD 0x01 /* owner read */ #define S_IWRITE 0x02 /* owner write */ #define S_IEXEC 0x04 /* owner execute */ #define S_IOREAD 0x08 /* public read */ #define S_IOWRITE 0x10 /* public write */ #define S_IOEXEC 0x20 /* public execute */ #define S_ISHARE 0x40 /* sharable */ #define S_IFDIR 0x80 /* directory */ </programlisting> <para> Only the owner or the super user may change the permissions of a file. </para> </refsect1> <refsect1><title>Diagnostics</title> <para> A successful call returns 0. A -1 is returned if the caller is not entitled to change permissions of "fname" cannot be found. </para> </refsect1> <refsect1><title>See Also</title> <para> OS-9 command "attr" </para> </refsect1> </refentry>