mirror of
https://github.com/php/doc-pl.git
synced 2026-04-26 08:18:09 +02:00
891c6af454
Big thanks again to @alfsb for creating these.
177 lines
4.9 KiB
XML
177 lines
4.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- EN-Revision: 6b48028aef8211f89ae6c9fefe64177de2f86e12 Maintainer: sobak Status: ready -->
|
|
<!-- $Revision$ -->
|
|
<!-- CREDITS: adi -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.mkdir">
|
|
<refnamediv>
|
|
<refname>mkdir</refname>
|
|
<refpurpose>Tworzy katalog</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>mkdir</methodname>
|
|
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>permissions</parameter><initializer>0777</initializer></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>recursive</parameter><initializer>&false;</initializer></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>resource</type><type>null</type></type><parameter>context</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Tworzy katalog podany w parametrze <parameter>directory</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>directory</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Ścieżka do katalogu
|
|
&tip.fopen-wrapper;
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>permissions</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Domyślnym ustawieniem jest 0777, co oznacza najszerszy możliwy
|
|
dostęp. Aby uzyskać więcej informacji o uprawnieniach do plików,
|
|
przeczytaj opis funkcji <function>chmod</function>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Argument <parameter>permissions</parameter> jest ignorowany w systemie Windows.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
Uwaga: Prawdopodobnie chciałbyś podać prawa dostępu jako
|
|
wartość oktalną (ósemkową), co oznacza, że powinieneś
|
|
poprzedzić je zerem.
|
|
Prawa dostępu mogą być także modyfikowane przez bieżący
|
|
umask, który możesz zmienić używając <function>umask</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>recursive</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Jeśli ustawiono na &true; to wszystkie katalogi nadrzędne dla podanego argumentu
|
|
<parameter>directory</parameter> także zostaną utworzone, przy użyciu tych samych uprawnień.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>context</parameter></term>
|
|
<listitem>
|
|
¬e.context-support;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Jeżeli katalog do stworzenia już istnieje, jest to uznawane za błąd i funkcja
|
|
w dalszym ciągu zwróci &false;. Użyj <function>is_dir</function> lub
|
|
<function>file_exists</function> aby sprawdzić czy katalog istnieje,
|
|
zanim spróbujesz go utworzyć.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Zgłasza <constant>E_WARNING</constant> jeśli katalog
|
|
już istnieje.
|
|
</para>
|
|
<para>
|
|
Zgłasza <constant>E_WARNING</constant> jeśli posiadane
|
|
uprawnienia nie pozwalają stworzyć katalogu.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Przykład użycia <function>mkdir</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
mkdir("/path/to/my/dir", 0700);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Użycie <function>mkdir</function> z parametrem <parameter>recursive</parameter></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Pożądana struktura katalogów
|
|
$structure = './depth1/depth2/depth3/';
|
|
|
|
// Aby utworzyć strukturę zagnieżdżoną, musi zostać
|
|
// podany parametr recursive
|
|
|
|
if (!mkdir($structure, 0777, true)) {
|
|
die('Nie udało się utworzyć katalogów...');
|
|
}
|
|
|
|
// ...
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>is_dir</function></member>
|
|
<member><function>rmdir</function></member>
|
|
<member><function>umask</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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
|
|
-->
|