.\" -*- 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 "5 février 2023" "Pages du manuel de Linux 6.03" .SH NOM realpath \- Renvoyer le chemin d'accès absolu .SH BIBLIOTHÈQUE Bibliothèque C standard (\fIlibc\fP, \fI\-lc\fP) .SH SYNOPSIS .nf \fB#include \fP \fB#include \fP .PP \fBchar *realpath(const char *restrict \fP\fIchemin\fP\fB,\fP \fB char *restrict \fP\fIchemin_résolu\fP\fB);\fP .fi .PP .RS -4 Exigences de macros de test de fonctionnalités pour la glibc (consulter \fBfeature_test_macros\fP(7))\ : .RE .PP \fBrealpath\fP()\ : .nf .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE >= 500 || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE .fi .SH DESCRIPTION \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. Si \fIchemin_résolu\fP est NULL, alors \fBrealpath\fP() utilise \fBmalloc\fP(3) pour allouer un tampon allant jusqu'à \fBPATH_MAX\fP octets pour contenir le chemin trouvé, et retourne un pointeur sur ce tampon. L'appelant doit libérer ce tampon avec \fBfree\fP(3). .SH "VALEUR RENVOYÉE" S'il n'y a pas d'erreur, \fBrealpath\fP() renvoie un pointeur sur \fIchemin_résolu\fP. .PP Sinon elle renvoie NULL, le contenu de \fIchemin_résolu\fP n'est pas défini et \fIerrno\fP prend la valeur du code d'erreur. .SH ERREURS .TP \fBEACCES\fP La permission de recherche ou de lecture n'est pas accordée pour un composant du chemin d'accès. .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 Une erreur d'entrée\-sortie est survenue lors de la lecture sur le système de fichiers. .TP \fBELOOP\fP Trop de liens symboliques ont été rencontrés en parcourant le chemin. .TP \fBENAMETOOLONG\fP Un élément du chemin d'accès dépasse \fBNAME_MAX\fP caractères de long ou le chemin d'accès complet dépasse \fBPATH_MAX\fP caractères. .TP \fBENOENT\fP Le fichier indiqué n'existe pas. .TP \fBENOMEM\fP Plus assez de mémoire. .TP \fBENOTDIR\fP Un élément du chemin d'accès n'est pas un répertoire. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .ad l .nh .TS allbox; lbx lb lb l l l. Interface Attribut Valeur T{ \fBrealpath\fP() T} Sécurité des threads MT\-Safe .TE .hy .ad .sp 1 .SH STANDARDS 4.4BSD, POSIX.1\-2001. .PP POSIX.1 indique que le comportement dans le cas où \fIchemin_résolu\fP est NULL dépend de l'implémentation. POSIX.1\-2008 spécifie le comportement décrit dans cette page. .SH NOTES Dans 4.4BSD et Solaris, la limite de longueur du chemin est \fBMAXPATHLEN\fP (dans \fI\fP). SUSv2 conseille \fBPATH_MAX\fP et \fBNAME_MAX\fP, dans \fI\fP ou fournis par \fBpathconf\fP(3). Un fragment de code typique serait .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. (Mais voir quand même la section des BOGUES.) .SS "Extensions GNU" Si l'appel échoue avec \fBEACCES\fP ou \fBENOENT\fP alors que \fIchemin_résolu\fP n'est pas NULL, alors le préfixe de \fIchemin\fP qui n'est pas lisible ou qui n'existe pas est renvoyé dans \fIchemin_résolu\fP. .SH BOGUES .\" .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. La version du standard POSIX.1\-2001 de cette fonctions est erronée par construction, car elle ne permet pas de connaître la taille nécessaire pour le tampon de sortie \fIchemin_résolu\fP. D'après POSIX.1\-2001, un tampon de taille \fBPATH_MAX\fP suffit, mais \fBPATH_MAX\fP n'est pas nécessairement une constante définie et peut être obtenue avec \fBpathconf\fP(3). En outre, interroger \fBpathconf\fP(3) n'aide pas vraiment, car d'une part POSIX prévient que les résultats de \fBpathconf\fP(3) peuvent être immenses et inappropriés pour allouer de la mémoire et d'autre part \fBpathconf\fP(3) peut renvoyer \fB\-1\fP indiquant que \fBPATH_MAX\fP est illimité. La fonctionnalité \fIchemin_résolu\ ==\ NULL\fP, non standard dans POSIX.1\-2008, permet d'éviter ces problèmes. .SH "VOIR AUSSI" \fBrealpath\fP(1), \fBreadlink\fP(2), \fBcanonicalize_file_name\fP(3), \fBgetcwd\fP(3), \fBpathconf\fP(3), \fBsysconf\fP(3) .PP .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier , David Prévot et bubu . .PP Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. .PP Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .