Server for Information Technologies ������ ��������������
������� �������������� ����������
(095) 932-9212, 932-9213, 939-0783
E-mail: [email protected]
������ �������� ����(!) ������������� ���������� CIT Forum CD-ROM

CHMOD(2)

��������
chmod - ��������� ������ ������� � �����

���������

        int chmod (path, mode)
        char *path;
        int mode;

��������
�������� path �������� ���������� �� ���������� ��� �����. ��������� ����� chmod ������������� ����� ������� � ���������� ����� � ������������ � ������ ��������, ������������ � ��������� mode.

���� ���� ������� ���������������� ��������� �������:
04000��� ���������� �������������� ����������� ������������� ������������.
020#0��� ���������� �������������� ����������� ������������� ������, ���� # ���� 7, 5, 3 ��� 1; ��������� ���������� �������, ���� # ���� 6, 4, 2 ��� 0.
01000��� ������������ - ��������� ������� ������ ����� ���������� ����������.
00400�������� ��� ������ ����������.
00200�������� ��� ������ ����������.
00100�������� ��� ���������� (� ������ �������� - ��� ���������) ����������.
00040�������� ��� ������ ������� ������.
00020�������� ��� ������ ������� ������.
00010�������� ��� ���������� (���������) ������� ������.
00004�������� ��� ������ ������� ��������������.
00002�������� ��� ������ ������� ��������������.
00001�������� ��� ���������� (���������) ������� ��������������.

��� ��������� ������ ������� � ����� ����������� ������������� ������������ �������� ������ ���� ����� �������������� ��������� ����� ��� �����������������.

���� ����������� ������������� ������������ �������� �� ����� �������������� �����������������, �� ��� ������������ (01000) ����������.

���� ����������� ������������� ������������ �������� �� ����� �������������� ����������������� � ����������� ������������� ������ �������� �� ����� �������������� ������ �����, �� ��� 02000 (�������������� ������������� ������ ��� ����������) ����������.

���� � ������������ ����� � ������� ������� 410 ��� ������������ ����� 1, ������������ ������� �� ������� ������� ������ �� ������� ��������, ����� ����������� ��������� ���������������� �������, ����������� ����. ���� ��� ��� �� �������������� ����� ������� ���� 413, �� ������������ ������� �� ������� ������� ������ �� ����������� ������. � ����� �������, ���� ��� ������������ ����� 1, �� ������� ������, ���������� �� ����, ��� �� ��������� (� ������� �������� ��� � ������), ���������� ����� �� ��������� ��� ���������� ������������, ������������ ���� ����, ��� ������ ���������� ����� �������.

���� ��� ������������� �������������� ������ ��� ���������� ����� 1, � ��� 00010 (���������� ��� ����� ��� ������) ����������, �� ��� �������� ����� ��������������� ����� ����� ����������, ��� ����� ��������� �� ���������� ����������� ������� open(2), creat(2), read(2)write(2) ��� ����� �����.

��������� ����� chmod ����������� �������� � ����� ������� �� ����������, ���� ��������� ���� �� ���� �� ��������� �������:

[ENOTDIR]
��������� �������� �� �������� ���������.
[ENOENT]
��������� ���� �� ����������.
[EACCES]
��� ���������� �������� ����������� ����� �� �����.
[EPERM]
����������� ������������� ������������ �� ����� �������������� ��������� ����� ��� �����������������.
[EROFS]
��������� ���� ���������� � �������� �������, ��������� ������ �� ������.
[EFAULT]
�������� path ��������� �� ������� ����������� �������� ��������� ������������.
[EINTR]
�� ����� ���������� ���������� ������ ���������� ������.
[ENOLINK]
���������� ��� path ��������� �� ��������� ���������, ����� � ������� � ������ ������ ���.
[EMULTIHOP] ���������� path ������� ������������� ��������� � ��������� �����������.

��. �����
chown(2), creat(2), fcntl(2), mknod(2), open(2), read(2), write(2).
chmod(1) � ����������� ������������.

�����������
��� �������� ���������� ��������� ����� 0; � ������ ������ ������������ -1, � ���������� errno ������������� ��� ������.
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT