Provided by: manpages-es-dev_4.21.0-2_all bug

NOMBRE

       opendir, fdopendir - abre un directorio

BIBLIOTECA

       Biblioteca Estándar C (libc, -lc)

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 to indicate the error.

ERRORES

       EACCES Permiso denegado.

       EBADF  fd is not a valid file descriptor opened for reading.

       EMFILE Se ha alcanzado el límite de descriptores de archivo abiertos para cada proceso.

       ENFILE Se ha alcanzado el límite máximo de archivos abiertos para el conjunto del sistema.

       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 since glibc 2.4.

ATRIBUTOS

       Para obtener una explicación de los términos usados en esta sección, véase attributes(7).
       ┌──────────────────────────────────────────────────────────────┬────────────────────┬───────────────────┐
       │ InterfazAtributoValor             │
       ├──────────────────────────────────────────────────────────────┼────────────────────┼───────────────────┤
       │ opendir(), fdopendir()                                       │ Seguridad del hilo │ Multi-hilo seguro │
       └──────────────────────────────────────────────────────────────┴────────────────────┴───────────────────┘

ESTÁNDARES

       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)

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  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.

Páginas de manual de Linux 6.03                 15 Diciembre 2022                                     opendir(3)