.\" -*- coding: UTF-8 -*- .\" Copyright (C) 1999 Andries Brouwer (aeb@cwi.nl) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Rewritten old page, 990824, aeb@cwi.nl .\" 2004-12-14, mtk, added discussion of resolved_path == NULL .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH REALPATH 3 "15 Septiembre 2017" "" "Manual del Programador de Linux" .SH NOMBRE realpath \- devuelve el nombre de camino absoluto en forma canónica .SH SINOPSIS .nf \fB#include \fP \fB#include \fP .PP \fBchar *realpath(const char *\fP\fIcamino\fP\fB, char *\fP\fIcamino_resuelto\fP\fB);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP \fBrealpath\fP(): .ad l .RS 4 .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE\ >=\ 500 || /* Glibc since 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _BSD_SOURCE .RE .ad .SH DESCRIPCIÓN \fBrealpath\fP() expands all symbolic links and resolves references to \fI/./\fP, \fI/../\fP and extra \(aq/\(aq characters in the null\-terminated string named by \fIpath\fP to produce a canonicalized absolute pathname. The resulting pathname is stored as a null\-terminated string, up to a maximum of \fBPATH_MAX\fP bytes, in the buffer pointed to by \fIresolved_path\fP. The resulting path will have no symbolic link, \fI/./\fP or \fI/../\fP components. .PP .\" Even if we use resolved_path == NULL, then realpath() will still .\" return ENAMETOOLONG if the resolved pathname would exceed PATH_MAX .\" bytes -- MTK, Dec 04 .\" .SH HISTORY .\" The .\" .BR realpath () .\" function first appeared in 4.4BSD, contributed by Jan-Simon Pendry. If \fIresolved_path\fP is specified as NULL, then \fBrealpath\fP() uses \fBmalloc\fP(3) to allocate a buffer of up to \fBPATH_MAX\fP bytes to hold the resolved pathname, and returns a pointer to this buffer. The caller should deallocate this buffer using \fBfree\fP(3). .SH "VALOR DEVUELTO" If there is no error, \fBrealpath\fP() returns a pointer to the \fIresolved_path\fP. .PP Otherwise, it returns NULL, the contents of the array \fIresolved_path\fP are undefined, and \fIerrno\fP is set to indicate the error. .SH ERRORES .TP \fBEACCES\fP Se ha denegado el permiso de lectura o búsqueda para un componente del prefijo del camino. .TP \fBEINVAL\fP .\" (In libc5 this would just cause a segfault.) \fIpath\fP is NULL. (In glibc versions before 2.3, this error is also returned if \fIresolved_path\fP is NULL.) .TP \fBEIO\fP Se ha producido un error de E/S al leer del sistema de ficheros. .TP \fBELOOP\fP Se encontraron demasiados enlaces simbólicos al traducir el nombre del fichero. .TP \fBENAMETOOLONG\fP Un componente del camino ha excedido \fBNAME_MAX\fP caracteres o un camino completo ha excedido \fBPATH_MAX\fP caracteres. .TP \fBENOENT\fP El fichero especificado no existe. .TP \fBENOMEM\fP Sin memoria. .TP \fBENOTDIR\fP Un componente del prefijo del camino no es un directorio. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfaz Atributo Valor T{ \fBrealpath\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .SH "CONFORME A" 4.4BSD, POSIX.1\-2001. .PP POSIX.1\-2001 says that the behavior if \fIresolved_path\fP is NULL is implementation\-defined. POSIX.1\-2008 specifies the behavior described in this page. .SH NOTAS En 4.4BSD y Solaris el límite de la longitud del camino es \fBMAXPATHLEN\fP (que se encuentra en ). SUSv2 establece \fBPATH_MAX\fP y \fBNAME_MAX\fP, como aparecen en o proporcionados por la función \fBpathconf\fP(3). Un fragmento típico de código fuente sería .PP .in +4n .EX #ifdef PATH_MAX path_max = PATH_MAX; #else path_max = pathconf(path, _PC_PATH_MAX); if (path_max <= 0) path_max = 4096; #endif .EE .in .PP .\".PP .\" 2012-05-05, According to Casper Dik, the statement about .\" Solaris was not true at least as far back as 1997, and .\" may never have been true. .\" .\" The 4.4BSD, Linux and SUSv2 versions always return an absolute .\" pathname. .\" Solaris may return a relative pathname when the .\" .I path .\" argument is relative. .\" The prototype of .\" .BR realpath () .\" is given in \fI\fP in libc4 and libc5, .\" but in \fI\fP everywhere else. (Véase la sección FALLOS.) .SS "Extensiones de GNU" If the call fails with either \fBEACCES\fP or \fBENOENT\fP and \fIresolved_path\fP is not NULL, then the prefix of \fIpath\fP that is not readable or does not exist is returned in \fIresolved_path\fP. .SH ERRORES .\" .LP .\" The libc4 and libc5 implementation contained a buffer overflow .\" (fixed in libc-5.4.13). .\" Thus, set-user-ID programs like .\" .BR mount (8) .\" needed a private version. The POSIX.1\-2001 standard version of this function is broken by design, since it is impossible to determine a suitable size for the output buffer, \fIresolved_path\fP. According to POSIX.1\-2001 a buffer of size \fBPATH_MAX\fP suffices, but \fBPATH_MAX\fP need not be a defined constant, and may have to be obtained using \fBpathconf\fP(3). And asking \fBpathconf\fP(3) does not really help, since, on the one hand POSIX warns that the result of \fBpathconf\fP(3) may be huge and unsuitable for mallocing memory, and on the other hand \fBpathconf\fP(3) may return \-1 to signify that \fBPATH_MAX\fP is not bounded. The \fIresolved_path\ ==\ NULL\fP feature, not standardized in POSIX.1\-2001, but standardized in POSIX.1\-2008, allows this design problem to be avoided. .SH "VÉASE TAMBIÉN" \fBrealpath\fP(1), \fBreadlink\fP(2), \fBcanonicalize_file_name\fP(3), \fBgetcwd\fP(3), \fBpathconf\fP(3), \fBsysconf\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García y Miguel Pérez Ibars . Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org>. .ME .