.\" -*- coding: UTF-8 -*- .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH unlinkat 2 "17 mai 2025" "Pages du manuel de Linux 6.15" .SH NOM unlink, unlinkat \- Détruire un nom et éventuellement le fichier associé .SH BIBLIOTHÈQUE Bibliothèque C standard (\fIlibc\fP,\ \fI\-lc\fP) .SH SYNOPSIS .nf \fB#include \fP .P \fBint unlink(const char *\fP\fIpath\fP\fB);\fP .P \fB#include \fP/* Définition des constantes \fBAT_*\fP */ \fB#include \fP .P \fBint unlinkat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpath\fP\fB, int \fP\fIflags\fP\fB);\fP .fi .P .RS -4 Exigences de macros de test de fonctionnalités pour la glibc (consulter \fBfeature_test_macros\fP(7)) : .RE .P \fBunlinkat\fP(): .nf Depuis la glibc 2.10 : _POSIX_C_SOURCE >= 200809L avant la glibc 2.10 : _ATFILE_SOURCE .fi .SH DESCRIPTION \fBunlink\fP() détruit un nom dans le système de fichiers. Si ce nom était le dernier lien sur un fichier, et si aucun processus n'a ouvert ce fichier, ce dernier est effacé, et l'espace qu'il utilisait est rendu disponible. .P Si le nom était le dernier lien sur un fichier, mais qu'un processus conserve encore le fichier ouvert, celui\-ci continue d'exister jusqu'à ce que le dernier descripteur le référençant soit fermé. .P Si le nom correspond à un lien symbolique, le lien est supprimé. .P Si le nom correspond à un socket, une FIFO ou un périphérique, le nom est supprimé mais les processus qui ont ouvert l'objet peuvent continuer à l'utiliser. .SS unlinkat() L'appel système \fBunlinkat\fP() fonctionne exactement comme \fBunlink\fP(2) ou \fBrmdir\fP(2) (en fonction de la présence ou non du drapeau \fBAT_REMOVEDIR\fP dans \fIflags\fP), les seules différences étant décrites ici. .P If \fIpath\fP is relative, then it is interpreted relative to the directory referred to by the file descriptor \fIdirfd\fP (rather than relative to the current working directory of the calling process, as is done by \fBunlink\fP() and \fBrmdir\fP(2) for a relative pathname). .P If \fIpath\fP is relative and \fIdirfd\fP is the special value \fBAT_FDCWD\fP, then \fIpath\fP is interpreted relative to the current working directory of the calling process (like \fBunlink\fP() and \fBrmdir\fP(2)). .P Si \fIpath\fP est absolu, alors \fIdirfd\fP est ignoré. .P \fIflags\fP est un masque de bits qui peut être 0 ou construit par un OU binaire de valeur de drapeaux qui contrôlent le fonctionnement de \fBunlinkat\fP(). Actuellement, un seul drapeau est défini\ : .TP \fBAT_REMOVEDIR\fP By default, \fBunlinkat\fP() performs the equivalent of \fBunlink\fP() on \fIpath\fP. If the \fBAT_REMOVEDIR\fP flag is specified, it performs the equivalent of \fBrmdir\fP(2) on \fIpath\fP. .P Consultez \fBopenat\fP(2) pour une explication de la nécessité de \fBunlinkat\fP(). .SH "VALEUR RENVOYÉE" En cas de succès, zéro est renvoyé. En cas d'erreur, \fB\-1\fP est renvoyé et \fIerrno\fP est définie pour préciser l'erreur. .SH ERREURS .TP \fBEACCES\fP Write access to the directory containing \fIpath\fP is not allowed for the process's effective UID, or one of the directories in \fIpath\fP did not allow search permission. (See also \fBpath_resolution\fP(7).) .TP \fBEBUSY\fP \fIpath\fP cannot be unlinked because it is being used by the system or another process; for example, it is a mount point or the NFS client software created it to represent an active but otherwise nameless inode ("NFS silly renamed"). .TP \fBEFAULT\fP \fIpath\fP pointe en dehors de l'espace d'adressage accessible. .TP \fBEIO\fP Une erreur d'entrée\-sortie s'est produite. .TP \fBEISDIR\fP \fIpath\fP refers to a directory. (This is the non\-POSIX value returned since Linux 2.1.132.) .TP \fBELOOP\fP Too many symbolic links were encountered in translating \fIpath\fP. .TP \fBENAMETOOLONG\fP \fIpath\fP était trop long. .TP \fBENOENT\fP A component in \fIpath\fP does not exist or is a dangling symbolic link, or \fIpath\fP is empty. .TP \fBENOMEM\fP La mémoire disponible du noyau n'était pas suffisante. .TP \fBENOTDIR\fP Un élément, utilisé comme répertoire, du chemin d'accès \fIchemin\fP n'est pas en fait un répertoire. .TP \fBEPERM\fP Le système ne permet pas la destruction des répertoires avec unlink, ou cette destruction nécessite des privilèges que le processus appelant n'a pas. (Il s'agit d'une erreur conseillée par POSIX. Comme précisé plus haut, Linux renvoie \fBEISDIR\fP dans ce cas.) .TP \fBEPERM\fP (spécifique Linux) Le système de fichiers ne permet pas la destruction avec unlink. .TP \fBEPERM\fP ou \fBEACCES\fP The directory containing \fIpath\fP has the sticky bit (\fBS_ISVTX\fP) set and the process's effective UID is neither the UID of the file to be deleted nor that of the directory containing it, and the process is not privileged (Linux: does not have the \fBCAP_FOWNER\fP capability). .TP \fBEPERM\fP Le fichier à détruire avec unlink est marqué immuable ou comme n'acceptant que des ajouts. (Voir \fBFS_IOC_SETFLAGS\fP(2const).) .TP \fBEROFS\fP \fIpath\fP est placé sur un système de fichiers en lecture seule. .P Les erreurs supplémentaires suivantes peuvent également se produire pour \fBunlinkat\fP() : .TP \fBEBADF\fP \fIpath\fP est relatif mais \fIdirfd\fP n'est ni \fBAT_FDWCD\fP ni un descripteur de fichier valable. .TP \fBEINVAL\fP \fIflags\fP contient un drapeau non valable. .TP \fBEISDIR\fP \fIpath\fP refers to a directory, and \fBAT_REMOVEDIR\fP was not specified in \fIflags\fP. .TP \fBENOTDIR\fP \fIpath\fP est relatif et \fIdirfd\fP est un descripteur de fichier faisant référence à un fichier qui n'est pas un dossier. .SH STANDARDS POSIX.1\-2008. .SH HISTORIQUE .TP \fBunlink\fP() .\" SVr4 documents additional error .\" conditions EINTR, EMULTIHOP, ETXTBSY, ENOLINK. SVr4, 4.3BSD, POSIX.1\-2001. .TP \fBunlinkat\fP() POSIX.1\-2008. Linux 2.6.16, glibc 2.4. .SS glibc On older kernels where \fBunlinkat\fP() is unavailable, the glibc wrapper function falls back to the use of \fBunlink\fP() or \fBrmdir\fP(2). When \fIpath\fP is relative, glibc constructs a pathname based on the symbolic link in \fI/proc/self/fd\fP that corresponds to the \fIdirfd\fP argument. .SH BOGUES Des problèmes dans le protocole sous\-jacent à NFS peuvent provoquer la disparition inattendue de fichiers encore utilisés. .SH "VOIR AUSSI" \fBrm\fP(1), \fBunlink\fP(1), \fBchmod\fP(2), \fBlink\fP(2), \fBmknod\fP(2), \fBopen\fP(2), \fBrename\fP(2), \fBrmdir\fP(2), \fBmkfifo\fP(3), \fBremove\fP(3), \fBpath_resolution\fP(7), \fBsymlink\fP(7) .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 , Frédéric Hantrais et Jean-Pierre Giraud . .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 .