view docs/ccguide/chmod.refentry @ 2772:0a3f4d8ea6d5

Found ENDC in wrong location in dwread.asm and dwwrite.asm. Corrected. Moved the native 6309 code in dwread.asm and dwwrite.asm into the H6309 labeled area and changed IFEQ H6309 to IFNE H6309. Also moved the 57600bps 6809 code to the default location. This change had been done in the old dwread.asm and dwwrite.asm files to make it easier to follow. Though these two files were overwritten from the HDBDOS project dwread.asm and dwwrite.asm files. So this conversion needed to be done again so it made the source easier to follow.
author drencor-xeen
date Wed, 23 Jan 2013 12:36:55 -0600
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 &lt;modes.h&gt;
</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>