matroz Fri Mar 8 06:42:14 2002 EDT
Added files:
/phpdoc/he/functions dir.xml
Log:
almost done
Index: phpdoc/he/functions/dir.xml
+++ phpdoc/he/functions/dir.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- EN-Revision: 1.00 Maintainer: matty Status: working -->
<reference id="ref.dir">
<title>�������� ������ �������</title>
<titleabbrev>������</titleabbrev>
<partintro>
<simpara>
��������� ������ ����� ���� : <function>dirname</function>,
<function>is_dir</function>, <function>mkdir</function>, �
<function>rmdir</function>,��� �� �����
<link linkend="ref.filesystem">Filesystem</link>.
</simpara>
</partintro>
<refentry id="function.chroot">
<refnamediv>
<refname>chroot</refname>
<refpurpose>��� �� ������ � root</refpurpose>
</refnamediv>
<refsect1>
<title>�����</title>
<methodsynopsis>
<type>bool</type><methodname>chroot</methodname>
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
</methodsynopsis>
<para>
���� �� ������ � root �� ������ ������ �
<parameter>directory</parameter>. ������ &false; �� �� ����
����� �� ������ � root , &true; ����.
</para>
<note>
<para>
��� �� ����� ������ �������� �� ���� ���� ������ ���
��������, ���� ��� ���� ���� ������ �� ������ � root
� / ���� ���� �����. ������� �� ����� ���� �� ���� ����
� CGI.
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.chdir">
<refnamediv>
<refname>chdir</refname>
<refpurpose>��� �����</refpurpose>
</refnamediv>
<refsect1>
<title>�����</title>
<methodsynopsis>
<type>bool</type><methodname>chdir</methodname>
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
</methodsynopsis>
<para>
���� �� ������ ������ ������� �� PHP �
<parameter>directory</parameter>. ������ &false; �� �� ����
����� �����, &true; ����.
</para>
</refsect1>
</refentry>
<refentry id="class.dir">
<refnamediv>
<refname>dir</refname>
<refpurpose>directory class</refpurpose>
</refnamediv>
<refsect1>
<title>�����</title>
<classsynopsis>
<ooclass><classname>dir</classname></ooclass>
<constructorsynopsis>
<methodname>dir</methodname>
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
</constructorsynopsis>
<fieldsynopsis>
<type>string</type><varname>path</varname>
</fieldsynopsis>
<methodsynopsis><type>string</type><methodname>read</methodname><void/></methodsynopsis>
<methodsynopsis><type>void</type><methodname>rewind</methodname><void/></methodsynopsis>
<methodsynopsis><type>void</type><methodname>close</methodname><void/></methodsynopsis>
</classsynopsis>
<para>
������ pseudo-object oriented ������ ���� �����. ������
<parameter>directory</parameter> ����. ��� ��������
���� ������ ���� ������� �����. ���� ������ ������� handle
�� �������� ����� ������ ����
<function>readdir</function>, <function>rewinddir</function> and
<function>closedir</function>. ������� path ���� ��
��� ����� ������� ������. ���� ����� ����� ������� :
read, rewind � close.
</para>
<para>
��� �� ���� ��� ���� ������� �������� <function>dir</function>'s
���� ������ ����. ��� ������ ������
��� ���� ������ ���(���� � ���
����� type ,��� <link linkend="language.operators.comparison">
Comparison Operators</link> ����� ����) &false; �� ����
, �� ��� ������ �������� ����� � &false; �����
�� ������.
<example>
<title><function>dir</function> �����</title>
<programlisting role="php">
<![CDATA[
$d = dir("/etc");
echo "Handle: ".$d->handle."<br>\n";
echo "Path: ".$d->path."<br>\n";
while (false !== ($entry = $d->read())) {
echo $entry."<br>\n";
}
$d->close();
]]>
</programlisting>
</example>
</para>
<note>
<para>
���� ��� ������� ���� ������ ���� ����� ����� read ��
system-dependent.
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.closedir">
<refnamediv>
<refname>closedir</refname>
<refpurpose>���� �����</refpurpose>
</refnamediv>
<refsect1>
<title>�����</title>
<methodsynopsis>
<type>void</type><methodname>closedir</methodname>
<methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam>
</methodsynopsis>
<para>
����� �� stream ������ ������� �� ���
<parameter>dir_handle</parameter>. � stream ���� ���
������ ���� �� �� <function>opendir</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.getcwd">
<refnamediv>
<refname>getcwd</refname>
<refpurpose>���� �� ����� ������ �������</refpurpose>
</refnamediv>
<refsect1>
<title>�����</title>
<methodsynopsis>
<type>string</type><methodname>getcwd</methodname>
<void/>
</methodsynopsis>
<para>
������ �� ����� ������ �������.
</para>
</refsect1>
</refentry>
<refentry id="function.opendir">
<refnamediv>
<refname>opendir</refname>
<refpurpose>����� ����� ������</refpurpose>
</refnamediv>
<refsect1>
<title>�����</title>
<methodsynopsis>
<type>resource</type><methodname>opendir</methodname>
<methodparam><type>string</type><parameter>path</parameter></methodparam>
</methodsynopsis>
<para>
������ ����� ������ ������ ������� ���������
<function>closedir</function>, <function>readdir</function>, �
<function>rewinddir</function>.
</para>
<para>
�� <parameter>path</parameter> ���� ����� �� ����� �����
�� ��� ���� ����� �� ������ ���� ������ ����� ��
������ ������ ������, <function>opendir</function> ����� &false; �
����� ����� PHP. ���� ������ �� ��� ������
<function>opendir</function> �� ��� ����� `@' ����
�� ��������.
</para>
<para>
<example>
<title><function>opendir</function> �����</title>
<programlisting role="php">
<![CDATA[
<?php
if ($dir = @opendir("/tmp")) {
while (($file = readdir($dir)) !== false) {
echo "$file\n";
}
closedir($dir);
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.readdir">
<refnamediv>
<refname>readdir</refname>
<refpurpose>��� ��� ������ ������</refpurpose>
</refnamediv>
<refsect1>
<title>�����</title>
<methodsynopsis>
<type>string</type><methodname>readdir</methodname>
<methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam>
</methodsynopsis>
<para>
������ �� �� ����� ��� ������ ������. ���� ������ ������� ����� ����
��� �� �������� ������ ������.
</para>
<para>
��� �� ���� ��� ���� ������� �������� <function>readdir</function>'s
���� ������ ����. ��� ������ ������
��� ���� ������ ���(���� � ���
����� type ,��� <link linkend="language.operators.comparison">
Comparison Operators</link> ����� ����) &false; �� ����
, �� ��� ������ �������� ����� � &false; �����
�� ������.
</para>
<para>
<example>
<title>��� �� �� ������ ������� ������</title>
<programlisting role="php">
<![CDATA[
// Note that !== did not exist until 4.0.0-RC2
<?php
$handle=opendir('/path/to/files');
echo "Directory handle: $handle\n";
echo "Files:\n";
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
/* This is the WRONG way to loop over the directory. */
while ($file = readdir($handle)) {
echo "$file\n";
}
closedir($handle);
?>
]]>
</programlisting>
</example>
</para>
<para>
��� �� �� �������� <function>readdir</function> ����� �� ����
<literal>.</literal>
� ��
<literal>..</literal>. �� ���� ���� ���, ����
��� ����:
<example>
<title>
��� �� �� ������ ������� ������ � ��� �� <literal>.</literal>
� <literal>..</literal>
</title>
<programlisting role="php">
<![CDATA[
<?php
$handle = opendir('.');
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}
closedir($handle);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.rewinddir">
<refnamediv>
<refname>rewinddir</refname>
<refpurpose>����� �� ����� ������ ������</refpurpose>
</refnamediv>
<refsect1>
<title>�����</title>
<methodsynopsis>
<type>void</type><methodname>rewinddir</methodname>
<methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam>
</methodsynopsis>
<para>
����� �� ����� ������ ������ �� ���
<parameter>dir_handle</parameter> ������ ������.
</para>
</refsect1>
</refentry>
</reference>
<!-- 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:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm