.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" This manpage is Copyright (C) 1992 Drew Eckhardt; .\" 1993 Michael Haardt, Ian Jackson. .\" .\" 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. .\" .\" Modified Sat Jul 24 12:01:10 1993 by Rik Faith .\" Added correction due to Nick Duffek , aeb, 960426 .\" Modified Wed Nov 6 04:07:10 1996 by Eric S. Raymond .\" Modified Fri Jan 31 17:51:14 1997 by Eric S. Raymond .\" Translated into Spanish Wed Feb 4 1998 by Gerardo Aburruzaga .\" García .\" Translation revised Mon Aug 17 1998 by Juan Piernas .\" .TH SYMLINK 2 "21 agosto 1997" "Linux 2.0.30" "Manual del Programador de Linux" .SH NOMBRE symlink \- construye un nombre nuevo para un fichero .SH SINOPSIS .B #include .sp .BI "int symlink(const char *" caminoviejo ", const char *" caminonuevo ); .SH DESCRIPCIÓN .B symlink crea un enlace simbólico llamado .I caminonuevo que contiene la cadena de caracteres .IR caminoviejo . A fin de encontrar un fichero o directorio, los enlaces simbólicos se interpretan en tiempo de ejecución como si los contenidos del enlace hubiesen sido sustituidos en el camino que se esté siguiendo. Los enlaces simbólicos pueden contener como componentes del camino .B .. y, si se emplean al principio del enlace, se refieren a los directorios padre de aquél en el que reside el enlace. Un enlace simbólico (también conocido como enlace blando) puede apuntar a un fichero existente o a uno que no existe; en este último caso se conoce como un enlace colgante. Los permisos de un enlace simbólico son irrelevantes; el propietario no se tiene en cuenta cuando se sigue el enlace, pero sí se comprueba cuando se quiere borrar o renombrar el enlace y éste está en un directorio con el bit pegajoso (STIcky) activado. Si .I caminonuevo existe, .I no será sobreescrito. .SH "VALOR DEVUELTO" En caso de éxito, se devuelve 0. En caso de error, se devuelve \-1 y se pone en .I errno un valor apropiado. .SH ERRORES .TP .B EPERM El sistema de ficheros que contiene .IR caminonuevo no admite la creación de enlaces simbólicos. .TP .B EFAULT .I caminoviejo o .I caminonuevo apuntan afuera de su espacio de direcciones accesible. .TP .B EACCES No se permite acceso de escritura en el directorio que contiene .I caminonuevo para el UID efectivo del proceso, o uno de los directorios de .IR caminonuevo no permite búsqueda (permiso de ejecución, x). .TP .B ENAMETOOLONG .IR caminoviejo " o " caminonuevo " eran muy largos." .TP .B ENOENT Un componente directorio en .I caminonuevo no existe o es un enlace simbólico colgante, o .I caminoviejo es la cadena vacía. .TP .B ENOTDIR Un componente usado como directorio en .IR caminonuevo no es, de hecho, un directorio. .TP .B ENOMEM No había bastante memoria del núcleo. .TP .B EROFS .I caminonuevo está en un sistema de ficheros de lectura exclusiva. .TP .B EEXIST .I caminonuevo ya existe. .TP .B ELOOP Se encontraron demasiados enlaces simbólicos al resolver .IR caminonuevo . .TP .B ENOSPC El dispositivo que contiene al fichero no tiene sitio para la nueva entrada de directorio. .TP .B EIO Se ha producido un error de E/S. .SH OBSERVACIONES No se hace ninguna comprobación sobre \fIcaminoviejo\fP. Borrar el nombre referenciado por un enlace simbólico borrará realmente el fichero (a menos que también tenga otros enlaces duros). Si no se desea este comportamiento, emplee .BR link . .SH "CONFORME A" SVr4, SVID, POSIX, BSD 4.3, X/OPEN. SVr4 documenta los códigos de error adicionales EDQUOT y ENOSYS. .SH FALLOS Vea .BR open (2) con referencia a varios ficheros con el mismo nombre, y NFS. .SH "VÉASE TAMBIÉN" .BR readlink (2), .BR link (2), .BR unlink (2), .BR rename (2), .BR open (2), .BR lstat (2), .BR ln (1)