mirror of
https://github.com/php/doc-es.git
synced 2026-04-28 17:43:11 +02:00
018c2a8d65
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@324252 c90b9560-bf6c-de11-be94-00142212c4b1
166 lines
4.3 KiB
XML
166 lines
4.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 5faa7a6747bca628b3bdcc9f93aec5603b65581f Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no Maintainer: andresdzphp -->
|
|
|
|
<refentry xml:id="function.eio-link" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>eio_link</refname>
|
|
<refpurpose>Crear un enlace duro par un fichero</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>eio_link</methodname>
|
|
<methodparam><type>string</type><parameter>path</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>new_path</parameter></methodparam>
|
|
<methodparam
|
|
choice="opt"><type>int</type><parameter>pri</parameter><initializer>EIO_PRI_DEFAULT</initializer></methodparam>
|
|
<methodparam
|
|
choice="opt"><type>callable</type><parameter>callback</parameter><initializer>NULL</initializer></methodparam>
|
|
<methodparam
|
|
choice="opt"><type>mixed</type><parameter>data</parameter><initializer>NULL</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>eio_link</function> crea el enlace duro dado por
|
|
<parameter>new_path</parameter> para un fichero especificado por
|
|
<parameter>path</parameter>.
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>path</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La ruta del fichero origen.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>new_path</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La ruta del fichero destino.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>pri</parameter></term>
|
|
<listitem>
|
|
&eio.request.pri.values;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>callback</parameter></term>
|
|
<listitem>
|
|
&eio.callback.proto;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Variable arbitraria pasada a <parameter>callback</parameter>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Ejemplo de <function>eio_link</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$nombre_fichero = dirname(__FILE__)."/symlink.dat";
|
|
touch($nombre_fichero);
|
|
$enlace = dirname(__FILE__)."/symlink.link";
|
|
$enlace_duro = dirname(__FILE__)."/hardlink.link";
|
|
|
|
function mi_llamada_retorno_hardlink($datos, $resultado) {
|
|
global $enlace, $nombre_fichero;
|
|
var_dump(file_exists($datos) && !is_link($datos));
|
|
@unlink($datos);
|
|
|
|
eio_symlink($nombre_fichero, $enlace, EIO_PRI_DEFAULT, "mi_llamada_retorno_symlink", $enlace);
|
|
}
|
|
|
|
function mi_llamada_retorno_symlink($datos, $resultado) {
|
|
global $enlace, $nombre_fichero;
|
|
var_dump(file_exists($data) && is_link($datos));
|
|
|
|
if (!eio_readlink($datos, EIO_PRI_DEFAULT, "mi_llamada_retorno_readlink", NULL)) {
|
|
@unlink($enlace);
|
|
@unlink($nombre_fichero);
|
|
}
|
|
}
|
|
|
|
function mi_llamada_retorno_readlink($datos, $resultado) {
|
|
global $nombre_fichero, $enlace;
|
|
var_dump($resultado);
|
|
|
|
@unlink($enlace);
|
|
@unlink($nombre_fichero);
|
|
}
|
|
|
|
eio_link($nombre_fichero, $enlace_duro, EIO_PRI_DEFAULT, "mi_llamada_retorno_hardlink", $enlace_duro);
|
|
eio_event_loop();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
bool(true)
|
|
bool(true)
|
|
string(%d) "%ssymlink.dat"
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member>eio_symlink</member>
|
|
</simplelist>
|
|
</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
|
|
-->
|