Files
php-doc-ru/reference/filesystem/functions/umask.xml
Andrey Gromov 9e39531ecb --
Provided by anonymous 81924 (lexrulezzz@mail.ru)

git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@342438 c90b9560-bf6c-de11-be94-00142212c4b1
2017-04-29 20:57:49 +00:00

108 lines
3.2 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 04b11e621f6ccf857368d90262f051a8d40c865d Maintainer: shein Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.umask">
<refnamediv>
<refname>umask</refname>
<refpurpose>Изменяет текущую umask</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>umask</methodname>
<methodparam choice="opt"><type>int</type><parameter>mask</parameter></methodparam>
</methodsynopsis>
<para>
<function>umask</function> устанавливает PHP umask
в значение <parameter>mask</parameter> &amp; 0777 и возвращает
старую umask. Если PHP используется в качестве серверного модуля,
umask будет восстанавливаться после окончания каждого запроса.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>mask</parameter></term>
<listitem>
<para>
Новая umask.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Вызов <function>umask</function> без аргументов вернёт текущую
umask, иначе будет возвращена старая umask.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <function>umask</function></title>
<programlisting role="php">
<![CDATA[
<?php
$old = umask(0);
chmod("/path/some_dir/some_file.txt", 0755);
umask($old);
// Проверка
if ($old != umask()) {
die('При восстановлении umask произошла ошибка');
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Избегайте использования этой функции в многопоточных веб-серверах.
Лучше изменить права файла с помощью функции <function>chmod</function>
после его создания. Использование <function>umask</function>
может привести к неожиданному поведению одновременно работающих
скриптов и самого веб-сервера, т.к. они все будут использовать
одну и ту же umask.
</para>
</note>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->