mirror of
https://github.com/php/doc-pl.git
synced 2026-04-23 14:58:02 +02:00
891c6af454
Big thanks again to @alfsb for creating these.
164 lines
4.3 KiB
XML
164 lines
4.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 2b56c905fb0d6fcab44cc0c2abdbf393fc2b69ea Maintainer: adi Status: ready -->
|
|
<!-- $Revision$ -->
|
|
<!-- CREDITS: sobak, grzesiek -->
|
|
<refentry xml:id="function.touch" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>touch</refname>
|
|
<refpurpose>Ustawia czas modyfikacji pliku</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>touch</methodname>
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>mtime</parameter><initializer>&null;</initializer></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>atime</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Próbuje ustawić czas dostępu i modyfikacji pliku o nazwie
|
|
<parameter>filename</parameter> na wartość podaną przez
|
|
<parameter>mtime</parameter>.
|
|
Zauważ, że czas dostępu jest zawsze modyfikowany, niezależnie od
|
|
ilości parametrów.
|
|
</para>
|
|
<para>
|
|
Jeśli plik nie istnieje, to zostanie utworzony.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>filename</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Nazwa pliku, który ma być zmodyfikowany.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mtime</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Czas modyfikacji. Jeśli parametr <parameter>mtime</parameter> ma wartość &null;,
|
|
zostanie użyty bieżący czas systemowy.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>atime</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Jeśli nie mm wartości &null;, to czas dostępu do podanego pliku zostanie ustawiony
|
|
na wartość <parameter>atime</parameter>. W przeciwnym wypadku zostanie ustawiony na
|
|
wartość przekazaną w parametrze <parameter>mtime</parameter>.
|
|
Jeśli, oba mają wartość &null;, zostanie użyty bieżący czas.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
Parametr <parameter>mtime</parameter> i <parameter>atime</parameter>
|
|
akceptują teraz wartość null.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>touch</function> przykład</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
if (touch($filename)) {
|
|
echo $filename . ' czas modyfikacji został zmieniony na bieżący czas';
|
|
} else {
|
|
echo 'Przykro mi ale Nie Mogę zmienić czasu modyfikacji pliku ' . $filename;
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>touch</function> użycie parametru <parameter>mtime</parameter></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// To jest czas modyfikacji, ustawimy go na jedną godzinę wstecz.
|
|
$time = time() - 3600;
|
|
|
|
// Modyfikujemy czas pliku
|
|
if (!touch('jakis_plik.txt', $time)) {
|
|
echo 'Coś się nie udało...';
|
|
} else {
|
|
echo 'Czas modyfikacji pliku ustawiony';
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.filesystem-time-res;
|
|
</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
|
|
-->
|