Provided by: manpages-es-dev_4.13-4_all
NOMBRE
opendir, fdopendir - abre un directorio
SINOPSIS
#include <sys/types.h> #include <dirent.h> DIR *opendir(const char *nombre); DIR *fdopendir(int fd); Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)): fdopendir(): Desde glibc 2.10: _POSIX_C_SOURCE >= 200809L Antes de glibc 2.10: _GNU_SOURCE
DESCRIPCIÓN
La función opendir() abre un flujo de directorio correspondiente al directorio nombre, y devuelve un puntero al flujo de directorio. El flujo se sitúa en la primera entrada del directorio. The fdopendir() function is like opendir(), but returns a directory stream for the directory referred to by the open file descriptor fd. After a successful call to fdopendir(), fd is used internally by the implementation, and should not otherwise be used by the application.
VALOR DEVUELTO
The opendir() and fdopendir() functions return a pointer to the directory stream. On error, NULL is returned, and errno is set appropriately.
ERRORES
EACCES Permiso denegado. EBADF fd is not a valid file descriptor opened for reading. EMFILE The per-process limit on the number of open file descriptors has been reached. ENFILE The system-wide limit on the total number of open files has been reached. ENOENT El directorio no existe o nombre es una cadena vacía. ENOMEM Memoria insuficiente para completar la operación. ENOTDIR nombre no es un directorio.
VERSIONES
fdopendir() is available in glibc since version 2.4.
ATRIBUTOS
Para obtener una explicación de los términos usados en esta sección, véase attributes(7). ┌───────────────────────┬────────────────────┬───────────────────┐ │Interfaz │ Atributo │ Valor │ ├───────────────────────┼────────────────────┼───────────────────┤ │opendir(), fdopendir() │ Seguridad del hilo │ Multi-hilo seguro │ └───────────────────────┴────────────────────┴───────────────────┘
CONFORME A
opendir() is present on SVr4, 4.3BSD, and specified in POSIX.1-2001. fdopendir() is specified in POSIX.1-2008.
NOTAS
Filename entries can be read from a directory stream using readdir(3). El descriptor de fichero asociado al flujo de directorio puede ser obtenido usando dirfd(3). The opendir() function sets the close-on-exec flag for the file descriptor underlying the DIR *. The fdopendir() function leaves the setting of the close-on-exec flag unchanged for the file descriptor, fd. POSIX.1-200x leaves it unspecified whether a successful call to fdopendir() will set the close-on-exec flag for the file descriptor, fd.
VÉASE TAMBIÉN
open(2), closedir(3), dirfd(3), readdir(3), rewinddir(3), scandir(3), seekdir(3), telldir(3)
COLOFÓN
Esta página es parte de la versión 5.10 del proyecto Linux man-pages. 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/.
TRADUCCIÓN
La traducción al español de esta página del manual fue creada por Urko Lusa <ulusa@lacueva.ddns.org>, Juan Piernas <piernas@ditec.um.es> y Miguel Pérez Ibars <mpi79470@alu.um.es> Esta traducción es documentación libre; lea la GNU General Public License Version 3 ⟨https://www.gnu.org/licenses/gpl-3.0.html⟩ 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 debian-l10n-spanish@lists.debian.org ⟨⟩.