mirror of
https://github.com/php/doc-es.git
synced 2026-03-25 07:52:21 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@337761 c90b9560-bf6c-de11-be94-00142212c4b1
190 lines
4.8 KiB
XML
190 lines
4.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 028c8b7bc80eabcb172511fcb5392e595e1eb324 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: yes Maintainer: seros -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.realpath">
|
|
<refnamediv>
|
|
<refname>realpath</refname>
|
|
<refpurpose>Devuelve el nombre de la ruta absoluta canonizado</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>realpath</methodname>
|
|
<methodparam><type>string</type><parameter>path</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>realpath</function> expande todos los enlaces simbólicos y
|
|
resuelve las referencias de caracteres '/./', '/../' y '/' extra, en
|
|
la ruta de entrada dada por <parameter>path</parameter> y devuelve el
|
|
nombre de la ruta absoluta canonizado.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>path</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La ruta que va a ser comprobada.
|
|
<note>
|
|
<para>
|
|
Aunque se debe proporcionar una ruta, el valor puede estar en blanco o ser &null;.
|
|
En estos casos, el valor es interpretado como el directorio actual.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el nombre de la ruta absoluta canonizado en caso de éxito. La ruta resultante
|
|
no tendrá componentes de enlaces simbólicos, '/./' o '/../'. Los delimitadores finales,
|
|
como \ y /, también son eliminados.
|
|
</para>
|
|
<para>
|
|
<function>realpath</function> devuelve &false; en caso de error, p.ej. si
|
|
el fichero no existe.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
El script en ejecución debe tener permisios de ejecución en todos los directorios de
|
|
la jerarquía, de lo contrario <function>realpath</function> devolverá
|
|
&false;.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<para>
|
|
Para sistema de ficheros que no tengan en cuenta las mayúsculas/minúsculas, <function>realpath</function> podría o
|
|
no normalizar las mayúsculas/minúsculas de cada carácter.
|
|
</para>
|
|
</note>
|
|
&fs.file.32bit;
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.3.0</entry>
|
|
<entry>
|
|
Antes de esta versión, si en sistemas *BSD el último compnente de <parameter>path</parameter>
|
|
no existía, <function>realpath</function> no fallaba. Ahora
|
|
<function>realpath</function> también falla en este caso.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>5.2.1</entry>
|
|
<entry>
|
|
Antes de esta versión, <function>realpath</function> devolvía &false;
|
|
si <parameter>path</parameter> era un string vacío o &null;.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>realpath</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
chdir('/var/www/');
|
|
echo realpath('./../../etc/passwd') . PHP_EOL;
|
|
|
|
echo realpath('/tmp/') . PHP_EOL;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
/etc/passwd
|
|
/tmp
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<example>
|
|
<title><function>realpath</function> en Windows</title>
|
|
<para>
|
|
En windows <function>realpath</function> cambiará las rutas del estilo unix al
|
|
estilo windows.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
echo realpath('/windows/system32');
|
|
|
|
echo realpath('C:\Archivos de programa\\');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
C:\WINDOWS\System32
|
|
C:\Archivos de programa
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>basename</function></member>
|
|
<member><function>dirname</function></member>
|
|
<member><function>pathinfo</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
|
|
-->
|