.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (C) 1999 Andries Brouwer (aeb@cwi.nl) .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" 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 "2 Mayo 2024" "Páginas de Manual de Linux 6.9.1" .SH NOMBRE realpath \- devuelve el nombre de camino absoluto en forma canónica .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP \fB#include \fP .P \fBchar *realpath(const char *restrict \fP\fIpath\fP\fB,\fP \fB char *restrict \fP\fIresolved_path\fP\fB);\fP .fi .P .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .P \fBrealpath\fP(): .nf .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE >= 500 || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE .fi .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. .P .\" 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 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. .P 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. (Before glibc 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 archivos. .TP \fBELOOP\fP Se encontraron demasiados enlaces simbólicos al traducir el nombre del archivo. .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 archivo especificado no existe. .TP \fBENOMEM\fP Sin memoria. .TP \fBENOTDIR\fP Un componente del prefijo de la ruta 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; lbx lb lb l l l. Interfaz Atributo Valor T{ .na .nh \fBrealpath\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .SH VERSIONES .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 ESTÁNDARES POSIX.1\-2008. .SH HISTORIAL 4.4BSD, POSIX.1\-2001, Solaris. .P 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. .P 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 .P .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 .P .\".P .\" 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.) .SH ERRORES .\" .P .\" 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) .PP .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 . .PP 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. .PP 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 .